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

Bug or unexpected behaviour in git show <rev>:a\b

From
DBDavid Burström <davidburstrom@spotify.com>
Date
Jan 24, 2020, 12:45 UTC
Message-ID
<CAA-mk2_jB2X1J-NCXQ92spa-fmEct9G9f1iQo7t8=rvD5coFDA@mail.gmail.com>
Hi!

As part of some experiments on running git on Windows, I found something unexpected. If I use e.g. bash to run the following in a repository:

git show HEAD:a\\b

the command stalls for a short while and then exits with 0 and prints nothing on stdout. I've verified this on git 2.25.0 and 2.21.0. I would have expected either "fatal: Path 'a\b' does not exist in 'HEAD'" or something of that nature. Nothing in "man git revisions" hint that backslash is treated specially. Is this a bug or is it an undocumented feature?

Best regards,
  David Burström
Next: Jeff King
Message 1 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.