Summary: use reflog
Junio C Hamano committed
Jan 23, 2009 at 10:47 UTC
84f76d066e002ca26a565f5c842799570f47410c
1 file changed
+14
-3
Summary
+14
-3
@@ -6,9 +6,19 @@ trap 'rm -f $tmp-*' 0
6
since="$1"
7
until="$2"
8
9
-git rev-list --no-merges "master@{$1}..master@{$2}" >"$tmp-0.txt"
10
-top="master@{$until}"
11
-bottom="master@{$since}"
9
+case 0 in
10
+1)
11
+ bottom=$(git rev-parse master@{"$1"})
12
+ top=$(git rev-parse master@{"$2"})
13
+ ;;
14
+0)
15
+ git rev-list --first-parent --since="$since" --until="$until" \
16
+ master >"$tmp-1" &&
17
+ bottom=$(tail -n 1 "$tmp-1") &&
18
+ top=$(head -n 1 "$tmp-1") &&
19
+ rm -f "$tmp-1"
20
+ ;;
21
+esac
22
23
num_patches=$(git rev-list --no-merges $bottom..$top | wc -l)
24
git shortlog -s -n --no-merges $bottom..$top >"$tmp-0.txt"
@@ -34,3 +44,4 @@ EOF
44
45
git shortlog -w72,2,4 --no-merges $bottom..$top
46
47
+git diff --dirstat $bottom..$top