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

Re: Git should preserve modification times at least on request

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 19, 2018, 21:58 UTC
Message-ID
<nycvar.QRO.7.76.6.1802192257100.31@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
In-Reply-To
<20180219212235.GA9891@helen.PLASMA.Xg8.DE>
Hi Peter,
On Mon, 19 Feb 2018, Peter Backes wrote:
Show 30 quoted lines
> please ensure to CC me if you reply as I am not subscribed to the list.
> 
> https://git.wiki.kernel.org/index.php/Git_FAQ#Why_isn.27t_Git_preserving_modification_time_on_files.3F 
> argues that git isn't preserving modification times because it needs to 
> ensure that build tools work properly.
> 
> I agree that modification times should not be restored by default, 
> because of the principle of least astonishment. But should it be 
> impossible? The principle of least astonishment does not mandate this; 
> it is not a paternalistic principle.
> 
> Thus, I do not get at all
> - why git doesn't *store* modification times, perhaps by default, but 
> at least on request
> - why git doesn't restore modification times *on request*
> 
> It is pretty annoying that git cannot, even if I know what I am doing, 
> and explicitly want it to, preserve the modification time.
> 
> One use case: I have lots of file lying around in my build directory 
> and for some of them, the modification time in important information to 
> me. Those files are not at all used with the build tool. In contrast to 
> git pull, git pull --rebase needs those to be stashed. But after the 
> pull and unstash, the mtime is gone. Boo.
> 
> Please provide options to store and restore modification times. It 
> shouldn't be hard to do, given that other metadata such as the mode is 
> already stored. It would make live so much easier. And the fact that 
> this has made into the FAQ clearly suggests that there are many others 
> who think so.

Since you already assessed that it shouldn't be hard to do, you probably want to put your money where your mouth is and come up with a patch, and then offer it up for discussion on this here mailing list.

Ciao, Johannes

Previous: Peter BackesNext: Peter Backes
Message 2 of 28 in “Git should preserve modification times at least on request”
  1. Peter BackesFeb 19, 2018
  2. Johannes SchindelinFeb 19, 2018
  3. Peter BackesFeb 19, 2018
  4. Theodore Ts'oFeb 20, 2018
  5. Johannes SchindelinFeb 20, 2018
  6. Peter BackesFeb 20, 2018
  7. Peter BackesFeb 20, 2018
  8. Johannes SchindelinFeb 20, 2018
  9. Peter BackesFeb 20, 2018
  10. Phillip WoodFeb 21, 2018
  11. Randall S. BeckerFeb 19, 2018
  12. Hilco WijbengaFeb 19, 2018
  13. Hilco WijbengaFeb 20, 2018
  14. Jeff KingFeb 20, 2018
  15. Peter BackesFeb 20, 2018
  16. Jacob KellerFeb 21, 2018
  17. Junio C HamanoFeb 20, 2018
  18. Derek FawcusFeb 21, 2018
  19. Ævar Arnfjörð BjarmasonFeb 21, 2018
  20. Peter BackesFeb 21, 2018
  21. Ævar Arnfjörð BjarmasonFeb 21, 2018
  22. Peter BackesFeb 21, 2018
  23. Randall S. BeckerFeb 21, 2018
  24. 'Peter Backes'Feb 22, 2018
  25. Andreas KreyFeb 26, 2018
  26. 'Peter Backes'Feb 26, 2018
  27. Derek FawcusFeb 22, 2018
  28. Konstantin KhomoutovFeb 23, 2018

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.