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

Re: Find a topic branch containing a commit

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 28, 2016, 15:11 UTC
Message-ID
<xmqqa8h1u7a8.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<a7cd0ee3-8281-b220-1acc-c9516325ecde@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 12 quoted lines
> On 07/27/2016 08:03 PM, Duy Nguyen wrote:
>>>
>>> https://github.com/mhagger/git-when-merged ?
>> 
>> Beautiful. If it had an option to show a topic (i.e. git-log from
>> merge base to merge point) I would be ecstatic.
>
> That's a good idea. I just created a pull request to add that feature:
>
>     https://github.com/mhagger/git-when-merged/pull/13
>
> Let me know what you think!

It would be nice to have a mode to give the result in a more human readable way.

I use when-merged to find where to queue a follow-on fix to a topic that has already graduated to 'master'. When the patch fixes an earlier mistake of the commit X, "git when-merged X master" gives me the merge's 40-hex object name, and the next step is almost always to pass it to "git describe [--contains]". This tells me down to which maintenace track the fix can go.

Of course I can get that information by running a separate "git describe [--contains] X", but when I'll be running "when-merged" anyway, it is a wasted step.

Then "git show" of the found merge tells me where the tip of the topic is and what the topic was called (older topic branches are culled sometime after they are merged to 'master' and relevant maintenance tracks), and allows me to queue the patch to the correct place (after re-creating the topic if necessary).

    
Previous: Michael Haggerty
Message 7 of 7 in “Find a topic branch containing a commit”
  1. Duy NguyenJul 27, 2016
  2. Stefan BellerJul 27, 2016
  3. Stefan BellerJul 27, 2016
  4. Duy NguyenJul 27, 2016
  5. Duy NguyenJul 27, 2016
  6. Michael HaggertyJul 28, 2016
  7. Junio C HamanoJul 28, 2016

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.