Re: [PATCH 1/6] Recognize magic pathspec as filenames
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Oct 13, 2011, 04:23 UTC
- Message-ID
- <CACsJy8CY=myfLpAbEA0=LCm+tCgS7jzEAxH3rnwQt4-RXyjW9w@mail.gmail.com>
- In-Reply-To
- <7v4nze7x61.fsf@alter.siamese.dyndns.org>
2011/10/13 Junio C Hamano <gitster@pobox.com>:
Show 5 quoted lines
> "git log :/foo" is ambiguous no matter how you slice it, if you are going > to look at only the first character in the string. It could be asking to > show only commits that touch the path in the top-level directory "foo" and > its subdirectories, or it could be asking to start traversal at a commit > with "foo" in the log message.
Yeah, I forgot the ":/" ref syntax. But because it's ambiguous anyway, should we disallow "git log :/foo"? Either "git log :/foo --" or "git log -- :/foo" is OK.
> Longhand magic pathspecs e.g. ":(icase)foo" might have better chance, but > not by a wide margin. It can be a rev that names the blob object in the > index registered for the literal path "'(icase)foo", or it could be an > element in the pathspec to match [Ff][Oo][[Oo].
It's unfortunate that ":" has so many meanings attached to it. I hope that our ambiguation detection code can be smart, based on context, to avoid unnecessary "--". For example, "git log :(icase)foo" can only mean pathspec magic (I hope..)
-- Duy