Re: Stat cache in .git/index hinders syncing of repositories
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 18, 2020, 18:15 UTC
- Message-ID
- <xmqq7e1od41x.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <87v9p9skjz.fsf@drac>
Christoph Groth <christoph@grothesque.org> writes:
Show 5 quoted lines
> However, there is one problem with syncing git repositories, that has > been noticed by multiple people [1]: The file .git/index contains not > only the “git index”, but also a cache of stat-data of the files in the > working directory. Some file synchronizers are able to sync mtimes, but > syncing ctimes would be bizarre (if it is even possible).
The stat-data in the index file is meant to be a mere optimization, and after copying .git/index and the working tree files to a new box, running "git update-index --refresh" would make them in sync, no?