Re: [PATCH/RFC] clone: report duplicate entries on case-insensitive filesystems
- From
Jeff King <peff@peff.net>
- Date
- Jul 31, 2018, 20:37 UTC
- Message-ID
- <20180731203746.GA9442@sigill.intra.peff.net>
- In-Reply-To
- <xmqqva8v9nc1.fsf@gitster-ct.c.googlers.com>
On Tue, Jul 31, 2018 at 01:12:14PM -0700, Junio C Hamano wrote:
Show 16 quoted lines
> Jeff King <peff@peff.net> writes: > > > On Tue, Jul 31, 2018 at 12:12:58PM -0700, Junio C Hamano wrote: > > ... > >> collapses two (or more) paths if we go that way. We only need to > >> report "we tried to check out X but it seems your filesystem equates > >> something else that is also in the project to X". > > > > Heh. See my similar suggestion in: > > > > https://public-inbox.org/git/20180728095659.GA21450@sigill.intra.peff.net/ > > > > and the response from Duy. > > Yes, but is there a reason why we need to report what that > "something else" is?
I don't think it's strictly necessary, but it probably makes things easier for the user. That said...
Show 5 quoted lines
> Presumably we are already in an error codepath, so if it is > absolutely necessary, then we can issue a lstat() to grab the inum > for the path we are about to create, iterate over the previously > checked out paths issuing lstat() and see which one yields the same > inum, to find the one who is the culprit.
Yes, this is the cleverness I was missing in my earlier response.
So it seems do-able, and I like that this incurs no cost in the non-error case.
-Peff