git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Better way to find commit from tarball?
@ 2010-09-06 19:55 Todd A. Jacobs
  2010-09-06 20:05 ` Jonathan Nieder
  0 siblings, 1 reply; 2+ messages in thread
From: Todd A. Jacobs @ 2010-09-06 19:55 UTC (permalink / raw)
  To: git

Someone handed me a tarball that represented an unknown release from a
project. Here's what I came up with to identify the commit:

    cd $SOME_WORK_DIR
    find . -path ./.git -prune -o -print0 | xargs -0 rm
    tar xvfz $TARBALL
    for commit in {0..100}; do
        id="master~${commit}"
        if git diff --quiet --exit-code "$id"
        then
            echo "Matched on commit $id"
            break
        fi
    done

Someone please tell me there's an easier way to find a matching tree
when handed a tarball. This works, but seems cumbersome.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-06 20:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-06 19:55 Better way to find commit from tarball? Todd A. Jacobs
2010-09-06 20:05 ` Jonathan Nieder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).