Re: Git doesn't detect change, if file modification time is restored to original one
- From
- Konrád Lőrinczi <klorinczi@gmail.com>
- Date
- Jul 23, 2015, 09:14 UTC
- Message-ID
- <CABEDGg_R49K61wiV9SsTnLS9SztHDjEQhOHjwzYn2JJwrrb-KA@mail.gmail.com>
- In-Reply-To
- <55B09E95.4000700@gmail.com>
Based on [1] I found some solutions which makes the changed files appear again as changed: a) touch -m --date=01/01/1980 .git/index So it is a touch, but only a single one, instead of touching all the files in the work dir.
b) git read-tree HEAD Also working well.
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?
Thanks, Konrad Lorinczi
[1] https://github.com/msysgit/git/issues/312
2015-07-23 9:58 GMT+02:00 Sebastian Schuberth <sschuberth@gmail.com>:
Show 13 quoted lines
> On 7/23/2015 9:29, Konrád Lőrinczi wrote: > >> Interesting, that git status doesn't show replaced changes, if the >> mtime is same as original. > > See the somewhat related FAQ entry at [1] and also the lengthy discussion at [2] about a similar issue. That said, deleting the .git/index file should make these files appear as modified. > > [1] https://git.wiki.kernel.org/index.php/Git_FAQ#Why_isn.27t_Git_preserving_modification_time_on_files.3F > [2] https://github.com/msysgit/git/issues/312 > > Regards, > Sebastian >