* search for equivalent commits by patch-id
@ 2014-06-19 12:26 vicentiu.neagoe
2014-06-20 7:43 ` Jeff King
0 siblings, 1 reply; 2+ messages in thread
From: vicentiu.neagoe @ 2014-06-19 12:26 UTC (permalink / raw)
To: git
Hello,
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.
thanks
Vicentiu
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: search for equivalent commits by patch-id
2014-06-19 12:26 search for equivalent commits by patch-id vicentiu.neagoe
@ 2014-06-20 7:43 ` Jeff King
0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2014-06-20 7:43 UTC (permalink / raw)
To: vicentiu.neagoe; +Cc: git
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-20 7:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-19 12:26 search for equivalent commits by patch-id vicentiu.neagoe
2014-06-20 7:43 ` Jeff King
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).