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

Re: Have git-merge-base support multiple IDs

From
JEJan Engelhardt <jengelh@medozas.de>
Date
Aug 3, 2009, 13:39 UTC
Message-ID
<alpine.LSU.2.00.0908031539070.2603@fbirervta.pbzchgretzou.qr>
In-Reply-To
<4A731A39.3090506@drmicha.warpmail.net>
On Friday 2009-07-31 18:22, Michael J Gruber wrote:
Show 19 quoted lines
>Jan Engelhardt venit, vidit, dixit 31.07.2009 17:51:
>> To determine the rebase point (i.e. first commit in a series),
>> one can (ab)use git-merge-base:
>> 
>>   p=$(git merge-base ab80794f faae2553)
>>   git re -i ${p}^
>> 
>> The twist is that merge-base in git 1.6.3.3 happens to ignore any 
>> further arguments following two IDs. In short:
>> 
>>   git merge-base A B C...
>> 
>> Only yields the merge-base of A and B, and ignores C...
>
>Uhm, are you sure about this?
>The first argument is special. merge-base computes the merge base between two commits:
>- the first argument
>- a (hypothetical) merge between all other arguments.
>It may look a if C was ignored, though.
Hm indeed. Is there a better way to find the common ancestor of commits?
Previous: Michael J GruberNext: Michael J Gruber
Message 3 of 4 in “Have git-merge-base support multiple IDs”
  1. Jan EngelhardtJul 31, 2009
  2. Michael J GruberJul 31, 2009
  3. Jan EngelhardtAug 3, 2009
  4. Michael J GruberAug 3, 2009

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.