Re: [PATCH/RFC] clone: report duplicate entries on case-insensitive filesystems
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 2, 2018, 21:14 UTC
- Message-ID
- <xmqqmuu4zd1l.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180802190644.GE23690@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> I also wonder if Windows could return some other file-unique identifier > that would work in place of an inode here. That would be pretty easy to > swap in via an #ifdef's helper function. I'd be OK shipping without that > and letting Windows folks fill it in later (as long as we do not do > anything too stupid until then, like claim all of the inode==0 files are > the same).
Yeah, but such a useful file-unique identifier would probably be used in place of inum in their (l)stat emulation already, if exists, no?
Show 8 quoted lines
> PS It occurs to me that doing this naively (re-scan the entries already > checked out when we see a collision) ends up quadratic over the > number of entries in the worst case. That may not matter. You'd only > have a handful of collisions normally, and anybody malicious can > already git-bomb your checkout anyway. If we care, an alternative > would be to set a flag for "I saw some collisions", and then follow > up with a single pass putting entries into a hashmap of > inode->filename.
Yeah, that makes sense.