Hi Andrew, On Fri, 16 Jan 2009 13:49:30 +1100 Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote: > > On Thu, 15 Jan 2009 17:59:17 -0800 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote: > > > > I do most of my gitting across a DSL connection. It makes GUIs > > painful. > > Yeah, I will think on it ... With the help of Paul Mackerras, I have come up with the shell script below. You run it with the commit id, the tag of the tree you care about (e.g. next-20080115)(it defaults to the current top of tree) and the name of the branch the represents Linus' tree (default to origin/master). It will spit out the (or a) tree that contains the commit you asked about. ------------------------------------------------------------------------- #!/bin/bash commit=$1 [ "$commit" ] || { echo "$0: <commit id> [<top tag> [<linus branch>]]" 1>&2 exit 1 } top=$2 [ "$top" ] || top=HEAD linus=$3 [ "$linus" ] || linus=origin/master base=$(git merge-base "$linus" "$top") git log --first-parent --pretty='format:%H %P' "$base".."$top" | while read m p1 p2 do [ "$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" break done exit 0 ---------------------------------------------------------------------------- -- Cheers, Stephen Rothwell sfr@xxxxxxxxxxxxxxxx http://www.canb.auug.org.au/~sfr/ -- To unsubscribe from this list: send the line "unsubscribe linux-next" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html