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

Re: multiple working directories for long-running builds (was: "git merge" merges too much!)

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Dec 1, 2009, 18:51 UTC
Message-ID
<20091201185114.GC11235@dpotapov.dyndns.org>
In-Reply-To
<m1NFX19-000kn4C@most.weird.com>
On Tue, Dec 01, 2009 at 12:59:58PM -0500, Greg A. Woods wrote:
Show 19 quoted lines
> At Tue, 1 Dec 2009 08:47:34 +0300, Dmitry Potapov <dpotapov@gmail.com> wrote:
> Subject: Re: "git merge" merges too much!
> > 
> > On Mon, Nov 30, 2009 at 07:24:14PM -0500, Greg A. Woods wrote:
> > > 
> > > Things get even weirder if you happen to be playing with older branches
> > > too -- most build tools don't have ability to follow files that go back
> > > in time as they assume any product files newer than the sources are
> > > already up-to-date, no matter how much older the sources might become on
> > > a second build.
> > 
> > No, files do not go back in time when you switch between branches. The
> > timestamp on files is the time when they are written to your working
> > tree
> 
> Hmmm, I didn't really say anything in particular about file timestamps
> -- I meant the file content may go back in time.  More correctly I
> should have said that the file content may become inconsistent with the
> state of other files that have just been compiled.

There is no difference of content going back in time or forth. If a file is changed, any decent build system should recompile the corresponding files. If the build does not handle dependencies properly, you can end up with inconsistent state just by editing some files.

> If the timestamps do not get set back to commit time, but rather are
> simply updated to move the last modify time to the time each change is
> made to a working file (which is as you said, to be expected),

More precisely, Git does not anything about modification time during checkout. The system automatically updates the modification time when a file is written, and Git does not mess with it.

> regardless of whether its content goes back in time or not, then this
> may or may not help a currently running build to figure out what really
> needs to be re-compiled.

Obviously, switching branches while running build may produce very confusing results, but it is not any different than editing files by hands during built -- any concurrent modification may confuse the build system.

> I just disagreed that "git archive" was a reasonable alternative to
> leaving the working directory alone during the entire time of the build.

Using "git archive" allows you avoid running long time procedure such as full clean build and testing in the working tree. Also, it is guaranteed that you test exactly what you put in Git and some other garbage in your working tree does not affect the result. But my point was that switching between branches and recompile a few changed files may be faster than going to another working tree.

Dmitry
Previous: Greg A. WoodsNext: Greg A. Woods
Message 26 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.