Re: [PATCH v3 0/1] clone: warn on colidding entries on checkout
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 10, 2018, 16:12 UTC
- Message-ID
- <xmqqr2j68ake.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180810153608.30051-1-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 10 quoted lines
> There are lots of suggestions on optimizing this stuff, but since this > problem does not affect me to begin with, I'm reluctant to make more > changes and going to stay simple, stupid and slow. I could continue to > do small updates if needed. But for bigger changes, consider this > patch dropped by me. > > v3 now uses inode on UNIXy platforms for checking colliding items. I > still don't try to separate colliding groups because it should be > quite obvious once you look at the colliding list (and most of the > time I suspect we only have one or two groups).
I think that design decision is fine. We can extend it later if needed, but I would not be surprised if what you have here is sufficient.
Another possible follow-up in the future may be to encapsulate the "I have a cache-entry 'dup', and stat data 'st' taken for a path in the working tree. Does it look likely that the latter is the result of checking out the former?" logic, which you currently has a hard-coded if() statement condition, into a helper function and make its implementation platform dependent.