git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Better way to find commit from tarball?

From
TJTodd A. Jacobs <tjacobs@si2services.com>
Date
Sep 6, 2010, 19:55 UTC
Message-ID
<AANLkTi=ZnZppPu8tT3-sUG6zZM8YnonPwMG_XZhO03up@mail.gmail.com>

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.

Next: Jonathan Nieder
Message 1 of 2 in “Better way to find commit from tarball?”
  1. Todd A. JacobsSep 6, 2010
  2. Jonathan NiederSep 6, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.