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

Re: git pull on Linux/ACPI release tree

From
Linus Torvalds <torvalds@osdl.org>
Date
Jan 8, 2006, 19:56 UTC
Message-ID
<Pine.LNX.4.64.0601081141450.3169@g5.osdl.org>
In-Reply-To
<46a038f90601081119r39014fbi995cc8b6e95774da@mail.gmail.com>
On Mon, 9 Jan 2006, Martin Langhoff wrote:
Show 5 quoted lines
> 
> I think it does. All the tricky stuff that David and Junio have been
> discussing is actually done very transparently by
> 
>     git-rebase <upstream>

Yes, it's fairly easy to do. That said, I would actually discourage it. I haven't said anything to David, because he is obviously very comfy with the git usage, and it _does_ result in cleaner trees, so especially since the networking code ends up being the source of a lot of changes, the extra cleanup stage that David does might actually be worth it for that case.

But git is actually designed to have parallel development, and what David does is to basically artificially linearize it. We merge between us often enough that it doesn't really end up losing any historical information (since David can't linearize the stuff that we already merged), but in _theory_ what David does actually does remove the historical context.

So "git-rebase" is a tool that is designed to allow maintainers to (as the command says) rebase their own development and re-linearize it, so that they don't see the real history. It's basically the reverse of what Len is doing - Len mixes up his history with other peoples history in order to keep them in sync, while David bassically "re-does" his history to be on top of mine (to keep it _separate_).

The "git-rebase" means that David will always see the development he has done/merged as being "on top" of whatever my most recent tree is. It's actually a bit scary, because if something goes wrong when David re-bases things, he'll have to clean things up by hand, and git won't help him much, but hey, it works for him because (a) things seldom go wrong and (b) he appears so comfortable with the tool that he _can_ fix things up when they do go wrong.

And yes, git-rebase can be very convenient. It has some problems too (which is the other reason I don't try to convince other maintainers to use it): because it re-writes history, a change that _might_ have worked in its original place in history might no longer work after a rebase if it depended on something subtle that used to be true but no longer is in the new place that it has been rebased to.

Which just means that a commit that was tested and found to be working might suddenly not work any more, which can be very surprising ("But I didn't change anything!").

On the other hand, this is no different from doing a merge of two independent streams of development, and getting a new bug that didn't exist in either of the two, just because they changed the assumptions of each other (ie not a _mismerge_, but simply two developers changing something that the other depended on it, and the bug only appears when both the working trees are merged and the end result no longer works).

So my suggested git usage is to _not_ play games. Neither do too-frequent merges _nor_ play games with git-rebase.

That said, git-rebase (and associated tools like "git-cherry-pick" etc) can be a very powerful tool, especially if you've screwed something up, and want to clean things up. Re-doing history because you realized that a you did something stupid that you don't want to admit to anybody else.

So trying out git-rebase and git-cherry-pick just in case you decide to want to use them might be worthwhile. Making it part of your daily routine like David has done? Somewhat questionable, but hey, it seems to be working for David, and it does make some things much easier, so..

			Linus
Previous: Martin LanghoffNext: David S. Miller
Message 4 of 21 in “RE: git pull on Linux/ACPI release tree”
  1. Brown, LenJan 8, 2006
  2. Linus TorvaldsJan 8, 2006
  3. Martin LanghoffJan 8, 2006
  4. Linus TorvaldsJan 8, 2006
  5. David S. MillerJan 8, 2006
  6. Luben TuikovJan 8, 2006
  7. Linus TorvaldsJan 9, 2006
  8. Junio C HamanoJan 8, 2006
  9. Linus TorvaldsJan 8, 2006
  10. Tony LuckJan 8, 2006
  11. Adrian BunkJan 8, 2006
  12. Willy TarreauJan 8, 2006
  13. Linus TorvaldsJan 9, 2006
  14. Adrian BunkJan 10, 2006
  15. Martin LanghoffJan 10, 2006
  16. Andreas EricssonJan 11, 2006
  17. Greg KHJan 12, 2006
  18. Adrian BunkJan 13, 2006
  19. Martin LanghoffJan 9, 2006
  20. Linus TorvaldsJan 10, 2006
  21. Catalin MarinasJan 12, 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.