Re: [PATCH 1/4] magic pathspec: add tentative ":/path/from/top/level" pathspec support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> writes:

> On Thu, Apr 7, 2011 at 11:18 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
>> This is so that you can say ":/.gitignore" and do not have to say
>> ":/:.gitignore".
>
> But then, say people have a file named @foo at top dir. They can write
> ":/@foo" to address the file. Some time later we decide to use '@' as
> magic, how can we re-train user's fingers?

You don't.  The primary goal of short form is to be short to type from the
command line, and if you are in doubt, you can always disambiguate by
saying ":/:@foo", and you can use the terminating colon even if you are
sure "@" is not a magic in your version of git.

Scripts can and should use the long form for readability and compatibility.

> Although I quite like it, one less keystroke for me.

Exactly.  It is Ok if the short form is a bit more complex to explain than
the long form (which should be very easy to explain).  The goal of the
short form is to make the end result is short to type, once the user
understands the rules.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]