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

Re: git merge vs git commit

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 9, 2008, 19:11 UTC
Message-ID
<7vd4jd6snt.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080909185418.GI4829@genesis.frugalware.org>
Miklos Vajna <vmiklos@frugalware.org> writes:
Show 5 quoted lines
> On Tue, Sep 09, 2008 at 10:34:42AM -0700, Junio C Hamano <gitster@pobox.com> wrote:
>> I think some changes went into 1.6.0 around this area to (r)eject parents
>> that are redundant.
>
> Yes, it was your 98cf9c3 (Introduce reduce_heads(), 2008-06-27).

That does not necessarily mean git-merge (or git-merge-octopus) uses that C function when coming up with the set of commits to record as parents.

As to what the correct behaviour is, I personally do not have a strong preference either way.

 - If you specify a fast-foward on the command line to merge into your
   HEAD, that is your choice and you may deserve the extra parent, even if
   it is redundant.  
 - On the other hand, if you try to merge a single fast-forward, we do not
   even create a merge commit, so in the same spirit it may be better if
   we dropped the original HEAD from the merged result (i.e. Russell's
   "cleanly merged" case).
I dunno.
Previous: Miklos VajnaNext: Matthieu Moy
Message 4 of 5 in “git merge vs git commit”
  1. Russell KingSep 9, 2008
  2. Junio C HamanoSep 9, 2008
  3. Miklos VajnaSep 9, 2008
  4. Junio C HamanoSep 9, 2008
  5. Matthieu MoySep 9, 2008

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.