Chad has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/333300 )
Change subject: Invalidate git index cache before smudging ...................................................................... Invalidate git index cache before smudging Occasionally we hit the problem where a git smudge filter is not triggered -- for instance, when a file in a working tree's lstat info matches the file in the git index cache. (see racy-git.txt in the git documentation) The previous work-around was touching the git-fat file; however, in cases where git fat checkout is automated there is a chance that touching the file will make no modification to the lstat information (when a touch happens in 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 can work around this by ensuring that the timestamp on a file is modified by looking at its previous timestamp and adding 1 to it. Bug: T147856 Change-Id: I9d126b669a71bfd3ce21acee8c3f5d4757e68523 --- M git-fat 1 file changed, 8 insertions(+), 3 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/git-fat b/git-fat index 24a1fd5..92ea88a 100755 --- a/git-fat +++ b/git-fat @@ -492,9 +492,14 @@ # the file in .git/fat/objects, but git caches the file stat # from the previous time the file was smudged, therefore it # won't try to re-smudge. I don't know a git command that - # specifically invalidates that cache, but touching the file - # also does the trick. - os.utime(fname, None) + # specifically invalidates that cache, but changing the mtime + # on the file will invalidate the cache. + # Here we set the mtime to mtime + 1. This is an improvement + # over touching the file as it catches the edgecase where a + # git-checkout happens within the same second as a git fat + # checkout. + stat = os.lstat(fname) + os.utime(fname, (stat.st_atime, stat.st_mtime + 1)) # This re-smudge is essentially a copy that restores # permissions. subprocess.check_call( -- To view, visit https://gerrit.wikimedia.org/r/333300 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9d126b669a71bfd3ce21acee8c3f5d4757e68523 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/git-fat Gerrit-Branch: master Gerrit-Owner: Thcipriani <tcipri...@wikimedia.org> Gerrit-Reviewer: Chad <ch...@wikimedia.org> Gerrit-Reviewer: Ottomata <ao...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits