jedbrown / git-fat

Simple way to handle fat files without committing them to git, supports synchronization using rsync
BSD 2-Clause "Simplified" License
622 stars 137 forks source link

Invalidate git index cache before smudging #83

Closed thcipriani closed 6 years ago

thcipriani commented 6 years ago

At Wikimedia we shell-out to git-fat from inside another piece of software. As a result we occasionally hit the problem where a git smudge filter is not triggered since there's a fair chance that the os.utime call inside git-fat that is intended to invalidate the git index cache is triggered within the same second as a git checkout. In those instances, git will not trigger the smudge filter and the file in the checkout will remain orphaned.

We worked around this by ensuring that the timestamp on a file is modified by looking at its previous timestamp and adding 1 to it. Submitting as a pull-request here in case this might be generally useful.

jedbrown commented 6 years ago

Thanks for finding this. I still don't know how to just invalidate the index without touching the file so I'll merge this as is.