From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Fwd: Possibly nicer pathspec syntax?
Date: Tue, 07 Feb 2017 19:12:38 -0800 [thread overview]
Message-ID: <xmqqa89xxtnd.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CA+55aFwPLtuPciN1o_03CwkKqFWgZd_br9Q14qyr7a7N7mxTeA@mail.gmail.com> (Linus Torvalds's message of "Tue, 7 Feb 2017 19:02:24 -0800")
Linus Torvalds <torvalds@linux-foundation.org> writes:
> No. The thing is, "git diff" is relative too - for path
> specifications. And the negative entries are pathspecs - and they act
> as relative ones.
>
> IOW, that whole
>
> cd drivers
> git diff A..B -- net/
>
> will actually show the diff for drivers/net - so the pathspec very
> much acts as relative to the cwd.
But that is not what I was talking about. Let's simplify. I'd say
for any command that acts on "everything" when pathspec is not
given, the two sets of actual paths affected by these two:
git cmd -- "net/"
git cmd -- ":!net/"
should have no overlap (obviously) and when you take union of the
two sets, that should equal to
git cmd --
i.e. no pathspecs.
>> 2. I am not sure what ctype.c change is about. Care to elaborate?
>
> I didn't see the need for it either until I made the rest of the
> patch, and it didn't work at all.
>
> The pathspec.c code uses "if (is_pathspec_magic(..))" to test whether
> a character is a short magiic pathspec character. But '^' wasn't in
> that set, because it was already marked as being (only) in the regex
> set.
>
> Does that whole is_pathspec_magic() thing make any sense when we have
> an array that specifies the special characters we react to? No it does
> not.
>
> But it is what the code does, and I just made that code work.
Ah, OK.
next prev parent reply other threads:[~2017-02-08 3:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CA+55aFyznf1k=iyiQx6KLj3okpid0-HexZWsVkxt7LqCdz+O5A@mail.gmail.com>
2017-02-07 23:12 ` Fwd: Possibly nicer pathspec syntax? Linus Torvalds
2017-02-08 0:54 ` Junio C Hamano
2017-02-08 1:48 ` Linus Torvalds
2017-02-08 2:40 ` Mike Hommey
2017-02-08 2:49 ` Linus Torvalds
2017-02-08 3:06 ` Mike Hommey
2017-02-08 2:42 ` Junio C Hamano
2017-02-08 3:02 ` Linus Torvalds
2017-02-08 3:12 ` Junio C Hamano [this message]
2017-02-08 3:28 ` Linus Torvalds
2017-02-08 4:42 ` Junio C Hamano
2017-02-08 5:12 ` Linus Torvalds
2017-02-08 6:39 ` Duy Nguyen
2017-02-08 17:39 ` Junio C Hamano
2017-02-08 21:11 ` Junio C Hamano
2017-02-09 13:48 ` Duy Nguyen
2017-02-09 13:27 ` Duy Nguyen
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=xmqqa89xxtnd.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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.