Skip to content

Commit 4b0129a

Browse files
committed
Add git-what-the-hell-just-happened
1 parent 2adc5fc commit 4b0129a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
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)