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

Finding a commit

From
SMSoham Mehta <soham@box.net>
Date
Oct 21, 2009, 11:29 UTC
Message-ID
<4ADEF095.3020406@box.net>

Given a SHA1 of a commit from one repository (say x), wondering what is a proper way to find out if that commit (change) also exists in a different repository (say y).

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 realize that Author and Timestamp do not change when the commit is moved (fetched, pushed, pulled, rebased, cherry-picked etc). So my current solution relies on grepping for the pair of Author-Timestamp from git-log on 'y'.

Wondering if there is more appropriate way of doing this?

Thanks. -Soham

Next: Daniele Segato
Message 1 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.