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

Re: [PATCH] builtin-commit: avoid using reduce_heads()

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Sep 26, 2008, 15:15 UTC
Message-ID
<20080926151517.GV23137@genesis.frugalware.org>
In-Reply-To
<20080926010312.GE6816@neumann>
On Fri, Sep 26, 2008 at 03:03:12AM +0200, SZEDER Gábor <szeder@ira.uka.de> wrote:
Show 15 quoted lines
> * FAIL 18: Hand committing of a redundant merge removes dups
>         
>         
>                 git rev-parse second master >expect &&
>                 test_must_fail git merge second master &&
>                 git checkout master g &&
>                 EDITOR=: git commit -a &&
>                 git cat-file commit HEAD | sed -n -e "s/^parent //p"
> -e "/^$/q" >actual &&
>                 test_cmp expect actual
>         
>         
> 
> * failed 1 among 18 test(s)
> make: *** [t7502-commit.sh] Error 1
OK, here is the scenario.

The basic problemis that if it's git-commit that creates the merge commit and not git-merge, then git-commit does not "know" that git-merge was invoked using --no-ff.

--no-ff means that if reduce_heads() removes a parent, that will be a problem, since the resulting commit will no longer be a merge commit.

I think we can't avoid storing this info in a MERGE_MODE file, because we have to add HEAD to the list of parents in case --no-ff is used, but we should not do so in case it's reachable from existing heads and --no-ff is not used.

I'll send a patch that does this in a bit.
Previous: Miklos VajnaNext: Miklos Vajna
Message 5 of 22 in “[BUG] merge --no-ff --no-commit && commit”
  1. SZEDER GáborSep 25, 2008
  2. builtin-commit: avoid using reduce_heads()Miklos Vajna, Sep 26, 2008
  3. SZEDER GáborSep 26, 2008
  4. Miklos VajnaSep 26, 2008
  5. Miklos VajnaSep 26, 2008
  6. builtin-commit: avoid always using reduce_heads()Miklos Vajna, Sep 26, 2008
  7. Shawn O. PearceSep 26, 2008
  8. builtin-commit: avoid always using reduce_heads()Miklos Vajna, Sep 26, 2008
  9. Shawn O. PearceOct 3, 2008
  10. builtin-commit: avoid always using reduce_heads()Miklos Vajna, Oct 3, 2008
  11. Shawn O. PearceOct 3, 2008
  12. builtin-commit: avoid always using reduce_heads()Miklos Vajna, Oct 5, 2008
  13. Shawn O. PearceOct 6, 2008
  14. builtin-commit: use reduce_heads() only when appropriateSZEDER Gábor, Oct 3, 2008
  15. Miklos VajnaOct 5, 2008
  16. Jakub NarebskiSep 26, 2008
  17. Miklos VajnaSep 26, 2008
  18. Jakub NarebskiSep 26, 2008
  19. Miklos VajnaSep 29, 2008
  20. Miklos VajnaSep 29, 2008
  21. Jakub NarebskiSep 29, 2008
  22. SZEDER GáborSep 27, 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.