git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: vicentiu.neagoe@ni.com
Cc: git@vger.kernel.org
Subject: Re: search for equivalent commits by patch-id
Date: Fri, 20 Jun 2014 03:43:46 -0400	[thread overview]
Message-ID: <20140620074346.GA3778@sigill.intra.peff.net> (raw)
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:

> 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

      reply	other threads:[~2014-06-20  7:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-19 12:26 search for equivalent commits by patch-id vicentiu.neagoe
2014-06-20  7:43 ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140620074346.GA3778@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=vicentiu.neagoe@ni.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).