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

Re: bug?: stgit creates (unneccessary?) conflicts when pulling

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Feb 27, 2006, 22:17 UTC
Message-ID
<44037A5C.6080409@gmail.com>
In-Reply-To
<20060227204252.GA31836@diana.vm.bytemark.co.uk>
Karl Hasselström wrote:
> If I make a patch series where more than one patch touches the same
> line, I get a lot of merge errors when upstream has accepted them and
> I try to merge them back.

We discussed about this in the thread announcing pg (http://article.gmane.org/gmane.comp.version-control.git/16247). This is not easy to fix because StGIT pushes patches one by one and it stops at the first conflict. Pg was trying to merge two patches at once but this is not suitable for StGIT since the latter keeps the patches as single commits.

There is another problem - the same line might have been modified by a third-party patch merged into the kernel (and the conflict solved by the maintainer).

> This situation arises for every line that's modified in more than one
> patch, and for every such patch except the last one. And it's really
> annoying, since it's intuitively obvious that there aren't actually
> any conflicts, since upstream accepted my patches verbatim.

Because I found the same situation a bit annoying, I added the --reset option to resolved. If you know your patch was merged without modifications, just use "stg resolved --all --reset local".

An idea (untested, I don't even know whether it's feasible) would be to check which patches were merged by reverse-applying them starting with the last. In this situation, all the merged patches should just revert their changes. You only need to do a git-diff between the bottom and the top of the patch and git-apply the output (maybe without even modifying the tree). If this operation succeeds, the patch was integrated and you don't even need to push it. The tool could even fold two consecutive patches and reverse-apply them. The disadvantage might be the delay when pushing patches but we could enable this test only if an option is passed to the pull command.

If you really want to make StGIT behave intelligently, have a look at the patch commuting theory in Darcs. It tends to handle this kind of conflicts easily. StGIT also does some patch commuting but using the diff3 algorithm and asks the user to fix different conflicts.

Catalin
Previous: Sam VilainNext: Catalin Marinas
Message 3 of 22 in “bug?: stgit creates (unneccessary?) conflicts when pulling”
  1. Karl HasselströmFeb 27, 2006
  2. Sam VilainFeb 27, 2006
  3. Catalin MarinasFeb 27, 2006
  4. Catalin MarinasFeb 28, 2006
  5. Catalin MarinasFeb 28, 2006
  6. Catalin MarinasFeb 28, 2006
  7. Chuck LeverMar 1, 2006
  8. Catalin MarinasMar 1, 2006
  9. Karl HasselströmMar 3, 2006
  10. Catalin MarinasMar 3, 2006
  11. Karl HasselströmMar 3, 2006
  12. Catalin MarinasMar 3, 2006
  13. Shawn PearceFeb 27, 2006
  14. Catalin MarinasMar 1, 2006
  15. Shawn PearceMar 1, 2006
  16. Catalin MarinasMar 1, 2006
  17. Shawn PearceMar 1, 2006
  18. Catalin MarinasMar 9, 2006
  19. Junio C HamanoMar 9, 2006
  20. Catalin MarinasMar 10, 2006
  21. Junio C HamanoMar 11, 2006
  22. Shawn PearceMar 10, 2006

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.