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

Re: pull into dirty working tree

From
Pierre Habouzit <madcoder@debian.org>
Date
Jun 13, 2007, 14:53 UTC
Message-ID
<20070613145342.GG5311@artemis.intersec.eu>
In-Reply-To
<18032.776.784080.321044@lisa.zopyra.com>
On Wed, Jun 13, 2007 at 09:45:28AM -0500, Bill Lear wrote:
Show 28 quoted lines
> [Pierre writes:]
> >  I suppose the following way would work:
> >
> >  $ git commit -a -m "temporary commit"  # save current work
> >  $ git branch -f dirty                  # ..in a separate branch
> >  $ git reset --hard HEAD~1              # unwind this commit
> >  $ git pull                             # perform a clean pull
> >  $ git rebase master dirty              # rewrite the work
> >  <you may have to fix some conficts here>
> >  $ git reset master                     # "undo" the commit
> >
> >  So that's definitely doable.
> >
> >  Though, in git, if you really work in a "pure" git environment, you
> >never pull until your work in your topic branch is ready for a merge.
> >It's a very bad habit to do otherwise: you don't _need_ to pull until
> >you have a clean slate.
> 
> I know, but I can't throw git purity at them as an explanation, they
> won't understand.  And they would disagree about the "need" to pull.
> That's for them to say: they WANT to pull without having to move aside
> the makefile that they modified to add the '-wingit' option to the
> compile line and just get on with their work without having to run 14
> different git commands.
> 
> I'm not trying to justify their habits, but to try to see if there is
> any clinching reason why this habit is not only "bad", but positively
> harmful.
  If it's because they have local modifications that match their use and
are not meant to be commited then I'd say that leaving it as "unclean"
work is a bad idea, because one day or the other they will have to
modify this Makefile to add a thing to commit for real. and then, 99
times over 100 they will commit their local modification too. _that_ is
harmful. And usually there is very soon a new commit to remove the local
change.
  I have a project where we had .htaccess that people had to customize
to have their local checkout work in the devel web server setup. It was
always commited (wrongly). We weren't using git.
  To solve those issues, there is many ways, not all are very handy, but
it works. The simplest way is to use a repository with a tool like
guilt, and each time you commit, you:
  guilt pop -a (remove your changes)
  ... do the stuff ...
  guilt push -a (push your changes again).
  Maybe you can also have a local branch where you store those local
changes. But that's still a bit awkward to use. Maybe someone will come
with a better workflow for this.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Bill LearNext: Randal L. Schwartz
Message 6 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.