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

Re: Finding a commit

From
DSDaniele Segato <daniele.bilug@gmail.com>
Date
Oct 21, 2009, 12:30 UTC
Message-ID
<9accb4400910210530k75a763cbtbc9294d937de9242@mail.gmail.com>
In-Reply-To
<4ADEF095.3020406@box.net>
On Wed, Oct 21, 2009 at 1:29 PM, Soham Mehta <soham@box.net> wrote:
> Because SHA1 can change if a commit is cherry-picked around, I cannot just
> grep for that SHA1 from git-rev-list or git-log on 'y'. I need a way to know
> if a commit with identical changes (as in 'x') is also present in 'y'.
I'm really not an expert of git..
but A commit is something like:
Commit -> Tree ---> Blob1, Blob2, Blob3

Commit, Trees and Blobs are all identified by sha1 the commit should keep information on the author, the "parent" commit(s) and so on.. the tree should just keep the "snapshot" of the data..

so I think that if you search for the SHA-1 of the tree you should be fine..

But I don't know how you can get the SHA-1 of the tree from a commit (may be git cat-file <commit-sha> could help you) and I don't know how to search for that tree around your index...

But I'm sure google (or whatever) has the answer to those questions,

regards, Daniele

Previous: Soham MehtaNext: Thomas Rast
Message 2 of 5 in “Finding a commit”
  1. Soham MehtaOct 21, 2009
  2. Daniele SegatoOct 21, 2009
  3. Thomas RastOct 21, 2009
  4. Daniele SegatoOct 21, 2009
  5. Douglas CamposOct 21, 2009

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.