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

Re: Shorthand for "$(git merge-base A B)"

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 18, 2019, 05:27 UTC
Message-ID
<xmqqva0g4uri.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190315212312.GA51592@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 7 quoted lines
> John Passaro wrote:
>
>> I find myself fairly frequently doing something like "git log $(git
>> merge-base A B)..C".
>
> Hm.  Can you tell me more about the workflow / higher-level operation
> where you do this?

Yes indeed, that would be interesting to learn. I can think of reasons why "git log ^A ^B C" may be useful, but I do not think of a case in which "git log --not $(git merge-base A B) --not C" [*1*] would become useful.

[Footnote]
*1* As there can be more than one merge-base between A and B, the
 right way to write what John wanted to write is to do the above.
 A single "--not" says "until you see another --not, take all the
 positive one from the command line as negative and vice versa".
 You can also write it as "git log C --not $(git merge-base A B)".
Previous: Jonathan Nieder
Message 3 of 3 in “Shorthand for "$(git merge-base A B)"”
  1. John PassaroMar 15, 2019
  2. Jonathan NiederMar 15, 2019
  3. Junio C HamanoMar 18, 2019

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.