git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug: magic-less pathspecs that start with ":" not processed as expected.
@ 2023-11-06 15:54 Joanna Wang
  2023-11-06 17:31 ` Jeff King
  2023-11-06 23:25 ` Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Joanna Wang @ 2023-11-06 15:54 UTC (permalink / raw)
  To: git

What did you do before the bug happened? (Steps to reproduce your issue)

What did you expect to happen? (Expected behavior)
`git stash push -- :file` where `:` is part of the filename, should search
for files named ":file"

What happened instead? (Actual behavior)
The match string used to find files is "file" without the ":".

What's different between what you expected and what actually happened?
file named ":file" is not found.

Anything else you want to add:
I believe this is due to parse_short_magic() not handling the case where
":" is part of the file name rather than a prefix for pathspec magic.

I could not find any documentation that says ":" is a reserved
character to indicate pathspec magic symbols MUST follow or that
":file" is not a valid file name.

[System Info]
git version 2.42.0
cpu: x86_64
no commit associated with this build
shell-path: /bin/sh

[Enabled Hooks]
not run from a git repository - no hooks to show

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-07  3:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-06 15:54 Bug: magic-less pathspecs that start with ":" not processed as expected Joanna Wang
2023-11-06 17:31 ` Jeff King
2023-11-06 23:29   ` Junio C Hamano
2023-11-07  3:25     ` Jeff King
2023-11-06 23:25 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).