exit 1
}
commit=$(git rev-parse --verify "$commit")
-[ "$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")
while read m p1 p2
do
[ "$p1" = "$commit" ] && {
- echo "Directly committed"
+ 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 .*'\([^']*\)'\( of \([^ ]*\).*\)*$/\1|\3/p")
- tree=${branch##*|}
- branch=${branch%%|*}
- [ "$tree" ] || {
- tree=${branch%%/*}
- [ "$tree" = "quilt" ] && tree=${branch##*/}
- echo "$tree"
- break
- }
- echo "$tree#$branch"
+ git show -s --pretty="format:Commit: %H%nAuthor: %aN <%aE>%nAuthorDate: %ad%nCommitter: %cN <%cE>%nCommitterDate: %cd%nSubject: %s" $m
break
done