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

Re: Git doesn't detect change, if file modification time is restored to original one

From
Karsten Blees <karsten.blees@gmail.com>
Date
Jul 23, 2015, 15:16 UTC
Message-ID
<55B1053D.7030006@gmail.com>
In-Reply-To
<20150723175342.77f635820fb9f1b69a73d39a@domain007.com>
Am 23.07.2015 um 16:53 schrieb Konstantin Khomoutov:
Show 20 quoted lines
> On Thu, 23 Jul 2015 11:14:11 +0200
> Konrád Lőrinczi <klorinczi@gmail.com> wrote:
> 
> [...]
>> I accept these solutions as workarounds, but the real solution would
>> be: Dev suggestions:
>> 1) Add a --force-reread option to git status, so user can force
>> reread tree. git status --force-reread
>>
>> 2) Add status.force-reread (true or false) option to .git/config so
>> user can set this variable permanently for a repo.
>> status.force-reread = false (should be default)
>>
>> Could be possible to implement 1) and 2) features to next git release?
> 
> Could you explain what's your real use case with preserving mtimes
> while changing the files?  I mean, implementing "mtime-stability"
> in your tools appears to be a good excersize in programming but what
> real-world problem does it solve?
> 

I'd like to add that this is not a git-specific problem: resetting mtime on purpose will fool lots of programs, including backup software, file synchronization tools (rsync, xcopy /D), build systems (make), and web servers / proxies (If-Modified-Since requests).

So you would typically reset mtime if you *want* programs to ignore the changes.

Previous: Konstantin KhomoutovNext: Junio C Hamano
Message 5 of 7 in “Git doesn't detect change, if file modification time is restored to original one”
  1. Konrád LőrincziJul 23, 2015
  2. Sebastian SchuberthJul 23, 2015
  3. Konrád LőrincziJul 23, 2015
  4. Konstantin KhomoutovJul 23, 2015
  5. Karsten BleesJul 23, 2015
  6. Junio C HamanoJul 23, 2015
  7. Johannes SchindelinJul 23, 2015

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.