git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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 ;-)

Previous: Jeff KingNext: Jeff King
Message 3 of 15 in “Bug or unexpected behaviour in git show <rev>:a\b”
  1. David BurströmJan 24, 2020
  2. Jeff KingJan 24, 2020
  3. Junio C HamanoJan 24, 2020
  4. Jeff KingJan 25, 2020
  5. David BurströmJan 25, 2020
  6. Junio C HamanoJan 27, 2020
  7. Jeff KingJan 25, 2020
  8. 1/3 t1400: avoid "test" string comparisonsJeff King, Jan 25, 2020
  9. 2/3 t1506: drop space after redirection operatorJeff King, Jan 25, 2020
  10. 3/3 sha1-name: mark get_oid() error messages for translationJeff King, Jan 25, 2020
  11. Junio C HamanoJan 29, 2020
  12. Junio C HamanoJan 29, 2020
  13. Jeff KingJan 30, 2020
  14. Junio C HamanoJan 30, 2020
  15. Jeff KingJan 31, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.