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

Re: "git merge" merges too much!

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Dec 1, 2009, 20:50 UTC
Message-ID
<20091201205057.GD11235@dpotapov.dyndns.org>
In-Reply-To
<m1NFXpl-000knKC@most.weird.com>
On Tue, Dec 01, 2009 at 01:52:18PM -0500, Greg A. Woods wrote:
Show 11 quoted lines
> At Mon, 30 Nov 2009 22:22:12 +0300, Dmitry Potapov <dpotapov@gmail.com> wrote:
> Subject: Re: "git merge" merges too much!
> > 
> > The key difference comparing to what you may got used is that branches
> > are normally based on the oldest branch in what this feature may be
> > included. Thus normally changes are not backported to old branches,
> > because you can merge them directly.
> 
> Hmmm... the idea of creating topic branches based on the oldest branch
> where the feature might be used is indeed neither intuitive, nor is it
> mentioned anywhere I've so far read about using topic branches in Git.

Most things that we consider "intuitive" are those that we got used to. Git is different in many aspect than other VCSes (such as CVS/SVN), and the workflow that good for those VCSes may not be optimal for Git. There is a good description that provide basic knowledge how to use Git:

man gitworkflows
or online:
http://www.kernel.org/pub/software/scm/git/docs/gitworkflows.html

If you do not base your changes on the oldest branch then you will not be able to merge changes, which implies you will have to cherry-pick manually without ability automatic to track what changes were merged and what were not, this is a recipe for a disaster...

Show 5 quoted lines
> At the moment I'm leaning towards a process where the configuration
> branch is re-created for every build -- i.e. the merges are redone from
> every topic branch to a freshly configured branch forked from the
> locally supported release branch, hopefully making use of git-rerere to
> solve most conflicts in as automated a fashion as is possible.

I am not quite sure that I fully understood your idea of configuration branches, but I want to warn you about one serious limitations of git-rerere -- it stores conflict resolution per-file basis. This means that if resolution of some conflict implies some change to another file then git-rerere will not help you here. So, it handles maybe 80-90% cases, but not all of them.

> 
> Perhaps Stacked-Git really is the best answer.  I will have to
> investigate more.

There is also TopGit. I have never used any of them, but if you are interested in patch management system, you probably should look at both of them. StGit is modelled after quilt, while TopGit is aimed to be better integrated with Git and better fit to work in distributed environment. But as I said, I do not have any first hand experience with any of them. (Personally, I would look at TopGit first, but maybe I am biased here).

Show 11 quoted lines
> > 
> > $ git branch new-foo foo
> > 
> > $ git rebase --onto newbase oldbase new-foo
> 
> Hmmm.... I'll have to think about that.  It makes some sense, but I
> don't intuitively read the command-line parameters well enough to
> predict the outcome in all of the scenarios I'm interested in.
> 
> what is "oldbase" there?  I'm guessing it means "base of foo" (and for
> the moment, "new-foo" too)?
You have:
 o---o---o---o---o  newbase
       \
        o---o---o---o---o  oldbase
                         \
                          o---o---o  foo
and you want this:
 o---o---o---o---o  newbase
     |            \
     |             o´--o´--o´  new-foo
      \
       o---o---o---o---o  oldbase
                         \
                          o---o---o  foo
Dmitry
Previous: Greg A. WoodsNext: Greg A. Woods
Message 6 of 33 in “"git merge" merges too much!”
  1. Greg A. WoodsNov 29, 2009
  2. Jeff KingNov 29, 2009
  3. Greg A. WoodsNov 30, 2009
  4. Dmitry PotapovNov 30, 2009
  5. Greg A. WoodsDec 1, 2009
  6. Dmitry PotapovDec 1, 2009
  7. Greg A. WoodsDec 1, 2009
  8. Dmitry PotapovDec 2, 2009
  9. Nanako ShiraishiDec 2, 2009
  10. Jeff KingDec 2, 2009
  11. Greg A. WoodsDec 3, 2009
  12. Junio C HamanoDec 3, 2009
  13. Greg A. WoodsDec 3, 2009
  14. Jeff KingDec 3, 2009
  15. Uri OkrentDec 3, 2009
  16. Marko KreenDec 3, 2009
  17. Greg A. WoodsDec 9, 2009
  18. Jeff KingDec 3, 2009
  19. Junio C HamanoNov 29, 2009
  20. Greg A. WoodsNov 30, 2009
  21. Junio C HamanoNov 30, 2009
  22. Dmitry PotapovNov 30, 2009
  23. Greg A. WoodsDec 1, 2009
  24. Dmitry PotapovDec 1, 2009
  25. Greg A. WoodsDec 1, 2009
  26. Dmitry PotapovDec 1, 2009
  27. Greg A. WoodsDec 1, 2009
  28. Dmitry PotapovDec 1, 2009
  29. Jeff EplerDec 1, 2009
  30. Greg A. WoodsDec 1, 2009
  31. Dmitry PotapovDec 2, 2009
  32. Greg A. WoodsDec 3, 2009
  33. Junio C HamanoDec 2, 2009

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.