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

Re: merge time

From
Steffen Prohaska <prohaska@zib.de>
Date
Jul 31, 2007, 18:06 UTC
Message-ID
<9DCA19D8-EDAE-4D04-A8C1-E0FF0A71DC93@zib.de>
In-Reply-To
<alpine.LFD.0.999.0707301038380.4161@woody.linux-foundation.org>
On Jul 30, 2007, at 7:42 PM, Linus Torvalds wrote:
Show 18 quoted lines
> On Mon, 30 Jul 2007, Jeff King wrote:
>>
>> If you followed a strict policy of always merging topics to a "base"
>> branch as your first parent, then never allowing fast forwards should
>> allow a very easy-to-read history in gitk.
>
> Only if only *one* person ever does any merges.
>
> Immediately when you have other people merging code, you're now  
> back in
> the same boat.
>
> This is why I personally think the whole policy of "no fast  
> forward" is
> totally broken. It's only usable in a non-distributed environment,  
> where
> there is one central person who does everything (a so-called "star
> topology").
I think no fast forward merges can always provide useful information.

Public releases are often created from a public, linear branch that is not arbitrarily jumping around. Even if more than one person creates such releases there must be some agreement upon the responsibility for the release and thus for the branch the releases are created from.

If all agreed to merge topics following the "no fast forward" policy and to use the release branch as a first parent, the commits along the first parents would document how commits came into the release branch. Non fast forward merges would always document that a series of commits was added to the release branch at once at the (local time) of the merge commit.

If fast forwards are allowed it depends on whether the release branch can be fast-forwarded over a series of commits on a topic branch or not. In case of fast-forward, the history makes you believe each of the commits of the topic branch entered the release branch separately. It hides that they were all merged at once.

I think, avoiding fast forwards may also be used to document a different level of quality required from commits to a topic branch and from commits to the release branch. A the time of the merge the tip of a topic branch must fulfill all quality requirements, for example compile on all platforms and pass all tests. But this need not be the case for every single commit on the topic branch. If you avoid fast forwards you still get a chain of commits along the first parent that would fulfill your quality requirements. If you allowed a fast forward over a low quality topic branch your chain might be broken and you can't be sure, which commits will have high quality and which one have a lower quality.

You may argue that this is all crap because every single commit should be of highest quality, but I think this is unrealistic. Especially if more than one person is jointly working on a topic branch and less experienced and more experienced developers work together. It may also be rational to first get the basic functionality right and later polish work for several platforms and usage scenarios.

Obviously other techniques, like rewriting a topic branch to a perfect commit series may be used as well. But from my understanding this may be hard if more than a single person is involved. You could also squash the complete topic branch into a single commit but then valuable history might get lost.

I don't see why what I have in mind would break if other people are merging code, too. They may or may not follow my local rules. But at the time of merging their changes, I can enforce my local quality policy and document this by create a merge commit.

This could even be applied recursively. You could start to do a couple of merges but only thoroughly test the final result of the last merge. You could then enforce a link between the last very stable commit before you did all the merges and the very well tested result after the final merge by enforcing a "no fast forward" merge.

I'm not quite sure if such a history would be useful in the long term or may just become to complex. I'm also not sure if the artificial links would cause any trouble. I'm wondering, for example, if there are any cases in which the additional links would make branching and merging harder.

	Steffen
Previous: Linus TorvaldsNext: david@lang.hm
Message 26 of 35 in “merge time”
  1. Matthew L FosterJul 29, 2007
  2. Jakub NarebskiJul 29, 2007
  3. Linus TorvaldsJul 29, 2007
  4. Matthew L FosterJul 30, 2007
  5. david@lang.hmJul 30, 2007
  6. Linus TorvaldsJul 30, 2007
  7. Matthew L FosterJul 30, 2007
  8. Linus TorvaldsJul 30, 2007
  9. Linus TorvaldsJul 30, 2007
  10. Matthew L FosterJul 30, 2007
  11. SeanJul 30, 2007
  12. Matthew L FosterJul 30, 2007
  13. Steffen ProhaskaJul 30, 2007
  14. Junio C HamanoJul 30, 2007
  15. Steffen ProhaskaJul 30, 2007
  16. Shawn O. PearceJul 30, 2007
  17. Steffen ProhaskaJul 30, 2007
  18. Jeff KingJul 30, 2007
  19. Junio C HamanoJul 30, 2007
  20. Jeff KingJul 30, 2007
  21. Steffen ProhaskaJul 30, 2007
  22. Jeff KingJul 30, 2007
  23. david@lang.hmJul 30, 2007
  24. Jeff KingJul 30, 2007
  25. Linus TorvaldsJul 30, 2007
  26. Steffen ProhaskaJul 31, 2007
  27. david@lang.hmJul 31, 2007
  28. Rogan DawesJul 30, 2007
  29. Matthew L FosterJul 30, 2007
  30. Johannes SchindelinJul 30, 2007
  31. Matthew L FosterJul 30, 2007
  32. Rogan DawesJul 30, 2007
  33. Matthew L FosterJul 30, 2007
  34. david@lang.hmJul 30, 2007
  35. Jakub NarebskiJul 30, 2007

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.