Re: [Census] So who uses git?
From: <hidden>
Date: 2016-06-15 22:42:17
Yes, I think the "assume unchanged" flag goes well together with making sure that the checked-out file is non-writable at the time. Of course, any number of editors and other actions won't care: if you do anything like for i in *.c do sed 's/xyzzy/bas/g' < $i > $i.new mv $i.new $i done you'll never have even noticed that the old file was marked read-only. So it's obviously not in any way any guarantee, but it probably makes sense as a crutch.
At the risk of complicating something already very complicated, and possibly breaking on Microsoft file systems, that case can be detected by reading the directory and noticing that the inode number changed. Would it be worth validating the inode numbers (which can be retrieved in a batch) even if you don't do a full lstat()? Or is that too Unix-centric and prone to performance problems on other file systems? I'd think that, even if a file system used fake inode numbers, they'd be pretty consistent if you didn't touch the file at all, and being different would just cause a more expensive validation. Which would be okay as long as it's infrequent.