All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/4] magic pathspec: add tentative ":/path/from/top/level" pathspec support
Date: Fri, 08 Apr 2011 09:37:24 -0700	[thread overview]
Message-ID: <7vpqow4s3f.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vtye84wc3.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Fri, 08 Apr 2011 08:05:48 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>
>> On Thu, Apr 7, 2011 at 11:18 PM, Junio C Hamano <gitster@pobox.com> 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.

Actually, after thinking a bit more about it, I changed my mind.

It is not such a big deal to require the terminating colon for a pathname
that begins with a nonalnum (except for '.' and we might find some others
perhaps '_'), as they are rare.

I agree that we should reserve most of the nonalnum ASCII as potential
magic, and require the terminating colon if the user wants to start the
pattern part with a potential magic signature letter and error out if we
see a magic that we do not support yet.  The reason I said "most of" is
that we should exclude some non-alnum letters that often begin a filename.

Off the top of my head, we should exclude "." (period -- dot-files are
common), "_" (underscore), and possibly "+" (plus) and "=" (equal), as I
saw these used to start filenames, but the latter two are rather rare and
I don't mind requiring the terminating colon after the magic signature.

  parent reply	other threads:[~2011-04-08 16:37 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07  1:16 [PATCH 0/4] Redoing the "add -u" migration plan Junio C Hamano
2011-04-07  1:16 ` [PATCH 1/4] magic pathspec: add tentative ":/path/from/top/level" pathspec support Junio C Hamano
2011-04-07  1:40   ` Junio C Hamano
2011-04-07 13:09     ` Nguyen Thai Ngoc Duy
2011-04-07 18:28       ` Junio C Hamano
2011-04-08 11:39         ` Nguyen Thai Ngoc Duy
2011-04-07 13:23   ` Nguyen Thai Ngoc Duy
2011-04-07 16:18     ` Junio C Hamano
2011-04-08 12:00       ` Nguyen Thai Ngoc Duy
2011-04-08 15:05         ` Junio C Hamano
2011-04-08 15:39           ` Nguyen Thai Ngoc Duy
2011-04-08 16:37           ` Junio C Hamano [this message]
2011-04-08 17:02             ` Nguyen Thai Ngoc Duy
2011-04-07  1:16 ` [PATCH 2/4] add -u: get rid of "treewideupdate" configuration Junio C Hamano
2011-04-08 17:54   ` Jeff King
2011-04-08 19:27     ` Junio C Hamano
2011-04-08 20:24       ` Jeff King
2011-04-08 22:22         ` Junio C Hamano
2011-04-08 22:32           ` Jeff King
2011-04-08 22:37             ` Junio C Hamano
2011-04-08 23:18               ` Junio C Hamano
2011-04-09  4:38                 ` Nguyen Thai Ngoc Duy
2011-04-09  4:56                   ` Junio C Hamano
2011-04-09  5:05                     ` Nguyen Thai Ngoc Duy
2011-04-09 21:34                       ` Junio C Hamano
2011-04-09  4:58                 ` Nguyen Thai Ngoc Duy
2011-04-09  5:20                   ` Junio C Hamano
2011-04-09 10:15                     ` Nguyen Thai Ngoc Duy
2011-04-09 11:24                   ` Nguyen Thai Ngoc Duy
2011-04-09 21:38                     ` Junio C Hamano
2011-05-03  7:52                 ` Nguyen Thai Ngoc Duy
2011-05-03 15:01                   ` Junio C Hamano
2011-05-03 16:17                     ` Nguyen Thai Ngoc Duy
2011-04-07  1:16 ` [PATCH 3/4] add: make "add -u/-A" update full tree without pathspec (step 2) Junio C Hamano
2011-04-07  1:16 ` [PATCH 4/4] add: make "add -u/-A" update full tree without pathspec (step 3) Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vpqow4s3f.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.