Re: [PATCH/alternative/raw and rough] setup.c: denote repo wide pathspecs by ':'
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Mar 1, 2011, 12:08 UTC
- Message-ID
- <AANLkTikzSsBZ757p4gnwsUrGNmRKHsxrqXeqPKyLihjT@mail.gmail.com>
- In-Reply-To
- <4D6CDF20.3020701@drmicha.warpmail.net>
On Tue, Mar 1, 2011 at 6:57 PM, Michael J Gruber <git@drmicha.warpmail.net> wrote:
Show 7 quoted lines
> HEAD:path is repo wide already > > :path is also, after this patch > > Note that when you have a file named :foo now, it can already be > mistaken as the blob at "foo" in the index (or HEAD) already, in places > where rev:path makes sense. So you would need quotation before my patch.
No. ':foo' as a reference to 'foo' in index is a SHA1-extended syntax and I think we try to avoid ambiguation when a sha1-extended syntax may look like a path or vice versa.
Show 7 quoted lines
>> Another, less cryptic choice, is to make these special notations >> separate from true pathspecs. For example, instead of ":foo" we can >> say "--root foo". get_pathspec() and friends can be updated to remove >> --root and rewrite the next pathspec. Extensibility is obvious. > > Only that some commands have "--root" as an option, and even if not, > it's just too much to type.
Yes, choose one between cryptic/short and descriptive/long :)
Show 11 quoted lines
>> Back to what I'm writing above, '-' may be chosen over ':' even >> without separation because UNIXers are trained that '-' is usually the >> beginning of something special, I suppose most of us would go with >> ./-blah for file names. > > If ":" is crazy which is in line with our current notation, then how do > you call "-"? "-" is > > - a short option identifier > - a negation (attributes) > - a notation for stdin
'-' is crazy, not ':'. Perhaps I'm embracing '-' too much.
-- Duy