Skip to content

Commit 9582e0a

Browse files
authored
Merge pull request #40 from unixorn/add-git-wth
Add git-what-the-hell-just-happened
2 parents 2adc5fc + 5771a9b commit 9582e0a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ If you aren't using any zsh frameworks, or if you're a bash user, do the followi
140140
| `git-unreleased` | Mislav Marohnić's [dotfiles](https://github.com/mislav/dotfiles) | Shows git commits since the last tagged version |
141141
| `git-up` | Ryan Tomayko's [dotfiles](http://github.com/rtomayko/dotfiles) | |
142142
| `git-upstream-sync` | Joe Block <jpb@unixorn.net> | Fetches upstream/yourforkname and rebases into your local fork, then pushes to your origin |
143+
| `git-what-the-hell-just-happened` | Gary Bernhardt's [dotfiles](https://github.com/garybernhardt/dotfiles/blob/master/bin/git-what-the-hell-just-happened) | Show what just happened |
143144
| `git-when-merged` | Michael Haggerty [git-when-merged](https://github.com/mhagger/git-when-merged) | Find when a commit was merged into one or more branches |
144145
| `git-where` | Mislav Marohnić's [dotfiles](https://github.com/mislav/dotfiles) | Shows where a particular commit falls between releases |
145146
| `git-winner` | Garry Dolley [https://github.com/up_the_irons/git-winner](https://github.com/up_the_irons/git-winner) | Shows what authors have made the most commits, both by number of commits and by number of lines changed |
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# Originally from Gary Bernhardt's dotfiles
3+
# https://github.com/garybernhardt/dotfiles/blob/master/bin/git-what-the-hell-just-happened
4+
5+
set -e
6+
7+
ref=${1:-"HEAD"}
8+
9+
old=$ref@{1}
10+
new=$ref
11+
12+
log() {
13+
git log --graph --pretty=short -1 $1
14+
}
15+
16+
echo "Old revision:"
17+
log $old
18+
echo
19+
echo "New revision:"
20+
log $new
21+
echo
22+
echo "Changes:"
23+
git diff --stat --summary $new $old

0 commit comments

Comments
 (0)