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

Re: pull into dirty working tree

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 14, 2007, 05:21 UTC
Message-ID
<alpine.LFD.0.98.0706132216300.14121@woody.linux-foundation.org>
In-Reply-To
<18031.64456.948230.375333@lisa.zopyra.com>
On Wed, 13 Jun 2007, Bill Lear wrote:
>
> We have some CVS users who complain that they cannot do a pull
> into a dirty working tree, as they could under CVS.

Well, a lot of people have told you that the answer is "don't do that", but I actually somewhat disagree.

I think it might be perfectly fine to allow for a *fast-forward* pull to do a three-way merge on the working tree, assuming the index is clean in the paths that got modified.

For a real merge (not just a fast-forward), we really *really* must not do it, for a very simple reason: we have no sane way to handle conflicts if we have both a merge from the pull itself _and_ a merge from the working tree. Don't get me wrong: I'm sure it's possible in theory, I just think that in practice it's such a total hairball that it's not worth it!

So I think we could actually try to allow "git pull" with a fast-forward pull and a dirty working tree.

(We obviously _already_ allow a working tree that is dirty in the paths that don't actually get changed at all! I use that all the time. So this is strictly limited to the "dirty state actually overlaps with what got pulled!)

It might make it a bit easier for CVS people to get used to the git model: keep your dirty working tree, and do "git pull" to update it, and fix up any conflicts in the working tree. That's how CVS works - it's a bad model, but it's a model that may be worth supporting just to get people more easily into the _good_ model.

		Linus
Previous: Daniel BarkalowNext: Junio C Hamano
Message 23 of 35 in “pull into dirty working tree”
  1. Bill LearJun 13, 2007
  2. Pierre HabouzitJun 13, 2007
  3. Pierre HabouzitJun 13, 2007
  4. Pierre HabouzitJun 13, 2007
  5. Bill LearJun 13, 2007
  6. Pierre HabouzitJun 13, 2007
  7. Randal L. SchwartzJun 13, 2007
  8. Alex RiesenJun 13, 2007
  9. Randal L. SchwartzJun 13, 2007
  10. Alex RiesenJun 13, 2007
  11. Randal L. SchwartzJun 13, 2007
  12. Alex RiesenJun 13, 2007
  13. Randal L. SchwartzJun 13, 2007
  14. Alex RiesenJun 13, 2007
  15. Johannes SchindelinJun 13, 2007
  16. Andy ParkinsJun 13, 2007
  17. Johannes SchindelinJun 13, 2007
  18. Bill LearJun 13, 2007
  19. Johannes SchindelinJun 13, 2007
  20. Bill LearJun 13, 2007
  21. Junio C HamanoJun 13, 2007
  22. Daniel BarkalowJun 14, 2007
  23. Linus TorvaldsJun 14, 2007
  24. Junio C HamanoJun 14, 2007
  25. Raimund BauerJun 14, 2007
  26. Steven GrimmJun 14, 2007
  27. Nicolas PitreJun 14, 2007
  28. Bill LearJun 14, 2007
  29. Linus TorvaldsJun 14, 2007
  30. Olivier GalibertJun 14, 2007
  31. Linus TorvaldsJun 14, 2007
  32. Martin LanghoffJun 15, 2007
  33. Linus TorvaldsJun 15, 2007
  34. Martin LanghoffJun 15, 2007
  35. Robin RosenbergJun 15, 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.