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

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

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Sep 26, 2008, 01:03 UTC
Message-ID
<20080926010312.GE6816@neumann>
In-Reply-To
<1222389359-22191-1-git-send-email-vmiklos@frugalware.org>
Szia Miklós,
On Fri, Sep 26, 2008 at 02:35:59AM +0200, Miklos Vajna wrote:
> reduce_heads() can filter "duplicated" parents, where "duplicated"
> means: A is duplicated if both A and B are parent candidates and A is
> reachable from B. Doing so in builtin-merge makes sense, but not in
> builtin-commit, because this breaks git merge --no-commit --no-ff.
> Here is a patch that fixes the problem for me.

Thanks for the quick response. While your patch does fix the bug I reported, unfortunately it introduces a new one: t7502-commit.sh fails at me with the following:

*   ok 17: a SIGTERM should break locks
* expecting success: 
        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
Already up-to-date with 1ae92d674ba95768a00bace571f5ef295ff1696b
Trying simple merge with 9af21aa779d9e148680be525ce161baa37e4bdec
Simple merge did not work, trying automatic merge.
Auto-merging g
ERROR: Merge conflict in g
fatal: merge program failed
Automatic merge failed; fix conflicts and then commit the result.
Created commit 45a4b2b: Merge branches 'second' and 'master' into
second
--- expect      2008-09-26 00:59:42.000000000 +0000
+++ actual      2008-09-26 00:59:42.000000000 +0000
@@ -1,2 +1,3 @@
 1ae92d674ba95768a00bace571f5ef295ff1696b
+1ae92d674ba95768a00bace571f5ef295ff1696b
 9af21aa779d9e148680be525ce161baa37e4bdec
* 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


Regards,
Gábor
Previous: Miklos VajnaNext: Miklos Vajna
Message 3 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.