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

Re: git and mtime

From
AArafangion <thestar@fussycoder.id.au>
Date
Nov 19, 2008, 12:37 UTC
Message-ID
<1227098252.11370.8.camel@therock.nsw.bigpond.net.au>
In-Reply-To
<20081119113752.GA13611@ravenclaw.codelibre.net>

On Wed, 2008-11-19 at 11:37 +0000, Roger Leigh wrote: <snip>

> different systems).  However, the fact that git isn't storing the
> mtime of the files confuses make, so it then tries to regenerate these
> (already up-to-date) files, and fails in the process since the tools
> aren't available.

Unless I'm mistaken, I was under the impression that the reason why git doesn't, and shouldn't do this is _because_ it confuses make.

Suppose you've got two branches, and you check out the other branch, resulting in changes in 3 files. Should git go and modify the mtime for every single file, and remove any file that isn't part of the repo (Such as generated object files)?

If it modifies the dates on every file, but doesn't remove the generated object files, how does make handle that, as it'll likely generate some of the object files, but not all of them.

If it doesn't, but touches the files that changed, and the dates are now older than the corresponding object files, make would fail to recompile the project properly!

The only way this could work is if you never switch branches, which is quite limiting for git, and never check out an older revision, which is quite limiting for the RCS systems in general.

You should probably fix your build script, or add a hook script that sets the dates on the files in question manually, but the former solution would be much better.

Previous: Johannes SchindelinNext: Matthieu Moy
Message 8 of 33 in “git and mtime”
  1. Roger LeighNov 19, 2008
  2. Matthias KestenholzNov 19, 2008
  3. Andreas EricssonNov 20, 2008
  4. Roger LeighNov 20, 2008
  5. Andreas EricssonNov 20, 2008
  6. Andreas EricssonNov 20, 2008
  7. Johannes SchindelinNov 19, 2008
  8. ArafangionNov 19, 2008
  9. Matthieu MoyNov 19, 2008
  10. Andreas EricssonNov 20, 2008
  11. Johannes SchindelinNov 20, 2008
  12. Matthieu MoyNov 20, 2008
  13. Jakub NarebskiNov 19, 2008
  14. Christian MICHONNov 19, 2008
  15. Johannes SchindelinNov 20, 2008
  16. Roger LeighNov 20, 2008
  17. Andreas EricssonNov 20, 2008
  18. Roger LeighNov 20, 2008
  19. Andreas EricssonNov 20, 2008
  20. Roger LeighNov 20, 2008
  21. Kyle MoffettNov 20, 2008
  22. Andreas EricssonNov 20, 2008
  23. Matthias KestenholzNov 20, 2008
  24. Randal L. SchwartzNov 20, 2008
  25. Roger LeighNov 20, 2008
  26. Daniel BarkalowNov 20, 2008
  27. Joey HessNov 20, 2008
  28. martin f krafftNov 20, 2008
  29. Roger LeighNov 20, 2008
  30. martin f krafftNov 20, 2008
  31. Samuel TardieuNov 20, 2008
  32. Johannes SchindelinNov 20, 2008
  33. Roger LeighNov 20, 2008

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.