From: Junio C Hamano Date: Mon, 06 Nov 2023 23:25:04 GMT Subject: Re: Bug: magic-less pathspecs that start with ":" not processed as expected. Message-ID: In-Reply-To: Joanna Wang 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, ":" is a notation for the object name sitting at in the index, so giving it from the command line is ambiguous, too. I thought that ./: 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.