echo "$0: <commit id> [<top tag> [<linus branch>]]" 1>&2
exit 1
}
+commit=$(git rev-parse --verify "$commit")
+[ "$commit" ] || {
+ echo "No such commit" 1>&2
+ exit 1
+}
top=$2
[ "$top" ] || top=HEAD
+tcommit=$(git rev-parse --verify "$top")
+[ "$tcommit" ] || {
+ echo "Bad top tag" 1>&2
+ exit 1
+}
linus=$3
[ "$linus" ] || linus=origin/master
+lcommit=$(git rev-parse --verify "$linus")
+[ "$lcommit" ] || {
+ echo "Bad linus branch" 1>&2
+ exit 1
+}
base=$(git merge-base "$linus" "$top")
-git log --first-parent --pretty='format:%H %P' "$base".."$top" |
+git log --first-parent --reverse --pretty='format:%H %P' "$base".."$top" |
while read m p1 p2
do
- [ "$p2" ] || continue
+ [ "$p1" = "$commit" ] && {
+ git show -s --pretty="format:Commit: %H%nAuthor: %aN <%aE>%nAuthorDate: %ad%nCommitter: %cN <%cE>%nCommitterDate: %cd%nSubject: %s" $p1
+ break
+ }
+ [ "$p2" ] ||
+ continue
git rev-list $base..$p2 | grep -q "$commit" || continue
- branch=$(git show $m | sed -n "s/[ ]*Merge .* '\([^']*\)'/\1/p")
- tree=${branch%%/*}
- [ "$tree" = "quilt" ] && tree=${branch##*/}
- echo "$tree"
+ git show -s --pretty="format:Commit: %H%nAuthor: %aN <%aE>%nAuthorDate: %ad%nCommitter: %cN <%cE>%nCommitterDate: %cd%nSubject: %s" $m
break
done