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

Re: search for equivalent commits by patch-id

From
Jeff King <peff@peff.net>
Date
Jun 20, 2014, 07:43 UTC
Message-ID
<20140620074346.GA3778@sigill.intra.peff.net>
In-Reply-To
<53A2D6E9.30341.4A8A1942@vicentiu.neagoe.ni.com>
On Thu, Jun 19, 2014 at 03:26:17PM +0300, vicentiu.neagoe@ni.com wrote:
Show 7 quoted lines
> Is there a way to find all equivalent commits by patch-id?
> 
> Something similar to:
> 
> git branch -a --commit <commit>
> 
> but instead of <commit> to search by patch-id.
There isn't a ready-made command to do so, but you can easily script it:
  git for-each-ref --format='%(refname)' refs/heads |
  while read ref; do
	echo "$(git diff-tree -p "$ref" | git patch-id) $ref"
  done |
  grep $PATCH_ID_YOU_ARE_LOOKING_FOR

If you want to look further back than the tips, you can feed the branches to rev-list, and then patch-id each commit you find.

The more common way to use patch-ids is to look for commits that are in one branch but not another. For that, try the "--cherry-pick" and "--cherry-mark" options to "git log".

-Peff
Previous: vicentiu.neagoe@ni.com
Message 2 of 2 in “search for equivalent commits by patch-id”
  1. vicentiu.neagoe@ni.comJun 19, 2014
  2. Jeff KingJun 20, 2014

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.