Jessica Clarke describes a problem on FreeBSD with UFS soft-updates. Among other uses of ctime, Git checks during a shallow clone that the shallow file has not changed since it was last read. The file is created by renaming shallow.lock and is stat'ed immediately to get the before value.

She says FreeBSD's soft-updates implementation updates ctime at the point of unlink, and so at rename, since rename is implemented internally with link plus unlink. It also updates ctime a second time once its asynchronous soft-updates work finishes. The excerpt is cut off, but she is evidently describing how the stored value can then differ from the file's later ctime.

brian m. carlson says he is not sure this is technically POSIX-compliant. He notes that rename(2) is documented to update ctime, and that POSIX allows an implementation to update timestamps immediately or periodically. He reads that as permitting an update only at the soft-update point or only immediately, but not twice for the same operation.

He adds that Git tries to accommodate systems that do not fully comply with POSIX, but that Git is likely not the only tool affected. He also points out that the function called is match_stat_data, so he believes the issue applies more broadly than the shallow check.

The thread has no patch or decision yet.