Subject: Re: Bug: magic-less pathspecs that start with ":" not processed as expected.

From: Junio C Hamano <[email-masked]>
Date: Tue, 07 Nov 2023 08:25:04 +0900

Joanna Wang <[email-masked]> writes:

> 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.

Also, ":<path>" is a notation for the object name sitting at <path>
in the index, so giving it from the command line is ambiguous, too.
I thought that ./:<path> would be a common way to talk about such a
path to git commands?

    $ date >./:now.txt
    $ git add ./:now.txt
    $ git rm ./:now.txt

I do not offhand remember where this is documented, but I agree that
we need to make sure that we give help to users on things like this
("how do I add a file whose name begins with a dash" is another
question I think we hear from time to time).

Thanks.