Re: Stat cache in .git/index hinders syncing of repositories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-01-18 at 19:06:21, Christoph Groth wrote:
> But if the above is not feasible for some reason, would it be possible
> to provide a switch for disabling stat caching optimization?

Git is going to perform really terribly on repositories of any size if
you disable stat caching, so we're not very likely to implement such a
feature.  Even if we did implement it, you probably wouldn't want to use
it.

However, there are the core.checkStat and core.trustctime options which
can control which information is used in the stat caching.  You can
restrict it to the whole second part of mtime and the file size if you
want.  See git-config(1) for more details.

Note that this assumes that (a) your sync tool can honor mtimes and (b)
that your sync tool syncs to another system of the same type.  You may
still run into problems if you share files between Linux and Windows
because symbolic links are different sizes there.  (This also bites
WSL.)  Since rsync can do the former, I think it's a reasonable
expectation that other tools can as well.

One final word of caution: you probably want to activate your sync tool
only manually and only when the repository is idle.  Tools like Dropbox
that automatically sync files one by one have been known to corrupt
repositories because the way they sync data leaves the repository in an
inconsistent state and doesn't honor standard POSIX file system
semantics which Git relies on for integrity.

Hopefully with that information you can find a configuration and tool
that work for you.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux