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

Re: Which branch(es) contain certain commits? (was Re: (unknown))

From
ICIvan Chernyavsky <camposer@yandex.ru>
Date
Aug 5, 2015, 19:48 UTC
Message-ID
<1758741438804110@web14m.yandex.ru>
In-Reply-To
<xmqqio8t4qf3.fsf@gitster.dls.corp.google.com>
Sorry for empty subject in the original mail, somehow I've deleted it and didn't even notice.
05.08.2015, 20:05, "Junio C Hamano" <gitster@pobox.com>:
Show 7 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>>  I think people do things like:
>>
>>      git log --all --decorate --grep=...
>
> s/decorate/source/; sorry for the noise.
Thanks Junio!
I was actually considering using --source, but for me the problem is it always returns *just one* branch for every matching commit. So the caller must then use his own knowledge to deduce all branches where this branch merged.
Considering following history:
* b46f30e       refs/heads/zzz eee
| * dc0280f     refs/heads/yyy ddd
|/
| * 31739da     refs/heads/xxx ccc
|/
* a42bd23       refs/heads/master bbb
* 01a8291       refs/heads/master aaa
Command "git log --all --source --grep=bbb --oneline" will return:
a42bd23 refs/heads/master bbb
While I'm expecting something like "git branch --contains=a42bd23" output in terms of *all* topics being listed:
  master
  xxx
  yyy
* zzz
The most common use case is when support people need to quickly get at least rough idea which branches have specific ticket/CR mentioned.
-- 
  Ivan
Previous: Junio C HamanoNext: Duy Nguyen
Message 4 of 12 in “(unknown)”
  1. Ivan ChernyavskyAug 5, 2015
  2. Which branch(es) contain certain commits? (was Re: (unknown))Junio C Hamano, Aug 5, 2015
  3. Junio C HamanoAug 5, 2015
  4. Ivan ChernyavskyAug 5, 2015
  5. Duy NguyenAug 15, 2015
  6. Ivan ChernyavskyAug 17, 2015
  7. Junio C HamanoAug 17, 2015
  8. Which branch(es) contain certain commits? (was Re: (unknown))Ivan Chernyavsky, Aug 21, 2015
  9. Junio C HamanoAug 21, 2015
  10. Ivan ChernyavskyAug 22, 2015
  11. Ivan ChernyavskyAug 22, 2015
  12. Karthik NayakAug 22, 2015

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.