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

Re: [PATCH] combine-diff: coalesce lost lines optimally

From
Antoine Pelisse <apelisse@gmail.com>
Date
Mar 17, 2013, 13:58 UTC
Message-ID
<CALWbr2xWYiFULLDVA7b9WrVtmfdAvZC9SKBHjZE9aRc6kfRMGA@mail.gmail.com>
In-Reply-To
<1363525436-21667-1-git-send-email-apelisse@gmail.com>
> I'm also having a hard time trying it with more than two parents. How I
> am supposed to have more than two parents while octopus merge refuses if
> there are conflicts ?
OK, creating the merge commit myself solves the issue:
git init
>test

git add test git commit -m initial

seq 100 >test git commit -m all -a

git checkout -b side1 HEAD^1 seq 1 2 100 >test git commit -m side1 -a

git checkout -b side2 HEAD^1 seq 1 4 100 >test git commit -m side2 -a

git checkout -b side3 HEAD^1 seq 1 8 100 >test git commit -m side3 -a

git checkout -b side4 HEAD^1 seq 1 16 100 >test git commit -m side4 -a

git checkout master
>test

git add test TREE=$(git write-tree) COMMIT=$(git commit-tree $TREE -p master -p side1 -p side2 -p side3 -p side4 -m merge) git show $COMMIT

This will work with the basic greedy implementation if all parents are in this order. But the optimal result will be lost if we change the order of -p parameters in git-commit-tree. The patch seems to be correct, always finding the best result (we always have 100 lines diff) whatever the order of parents.

Previous: Antoine PelisseNext: Junio C Hamano
Message 5 of 9 in “[RFD] Combine diff improvements”
  1. Antoine PelisseMar 14, 2013
  2. Junio C HamanoMar 14, 2013
  3. Junio C HamanoMar 15, 2013
  4. combine-diff: coalesce lost lines optimallyAntoine Pelisse, Mar 17, 2013
  5. Antoine PelisseMar 17, 2013
  6. Junio C HamanoMar 17, 2013
  7. Antoine PelisseMar 17, 2013
  8. Junio C HamanoMar 17, 2013
  9. combine-diff: coalesce lost lines optimallyAntoine Pelisse, Mar 23, 2013

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.