Re: Bug or unexpected behaviour in git show <rev>:a\b
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 24, 2020, 19:27 UTC
- Message-ID
- <xmqqk15gzmc8.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20200124190119.GB1672342@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 6 quoted lines
> So everything is working as designed, or at least explainable. But I > think there is some room for improvement. A backslash that isn't > followed by a glob meta-character _is_ still a meta character (your > "a\b" would be globbing for "ab"). But it's useless enough that I think > it shouldn't be enough to trigger the "oh, you probably meant this as a > pathspec" DWIM rule.
This sounds sensible.
Show 5 quoted lines
> We _could_ also say "even though this could technically be a pathspec > because of its metacharacter, it looks vaguely enough like a > path-in-tree revision that we shouldn't guess". That I'm less > comfortable with, just because it makes the heuristics even more > magical.
Not just it becomes more magical, I am afraid that the code to implement such a heuristics would be fragile and become a source of unnecessary bugs. Let's not go there.
I should learn to use "working as designed or at least explainable" more often in my responses, by the way. That's quite a useful and good phrase ;-)