From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: "Git Mailing List" <git@vger.kernel.org>,
"Christian Couder" <christian.couder@gmail.com>,
"Matthieu Moy" <Matthieu.Moy@grenoble-inp.fr>,
"Toralf Förster" <toralf.foerster@gmx.de>
Subject: Re: [PATCH] Support pathspec magic :(exclude) and its short form :-
Date: Thu, 21 Nov 2013 10:43:24 -0800 [thread overview]
Message-ID: <xmqqpppt4mur.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CACsJy8AeL+EVZme3BPocXDfRqPpqKDA8nCuwx3buiS66L7G4fA@mail.gmail.com> (Duy Nguyen's message of "Thu, 21 Nov 2013 09:10:50 +0700")
Duy Nguyen <pclouds@gmail.com> writes:
> Btw I'm thinking of extending pathspec magic syntax a bit to allow
> path completion. Right now the user has to write
>
> git log -- :-Documentation
>
> which does not play well with path completion. I'm thinking of accepting
>
> git log -- :- Documentation
Please don't. That does not help our users, but actively harm them.
They have to stop and wonder why a single pathspec is spelled as two
tokens on the command line of some other people.
Doing that stupidity only to help those who polish the tool (namely,
"bash completion") to be lazy is doubly wrong (in the meantime, the
users can type your second variant and then edit the result).
For the same reason why I do not think rewriting
echo "hello, world!"
to
echo "hello, world-"
only to work around a pitfall of a particular tool (namely "bash")
makes any sense, I do not think it makes sense to make _our_ tool
inconsistent by using "!excluded" in the files (and --exclude) and
"-not this pattern" only here.
>>> + if (nr_exclude == n)
>>> + die(_("There is nothing to exclude from by :(exclude) patterns.\n"
>>> + "Perhaps you forgot to add either ':/' or '.' ?"));
>>
>> ;-).
>
> Hey it was originally not there,...
I am not objecting. I noticed it and was commending on it as "a nice
touch" ;-)
>>> + /*
>>> + * # | positive | negative | result
>>> + * -----+----------+----------+-------
>>> + * 1..4 | -1 | * | -1
>>> + * 5..8 | 0 | * | 0
>>> + * 9 | 1 | -1 | 1
>>> + * 10 | 1 | 0 | 1
>>> + * 11 | 1 | 1 | 0
>>> + * 12 | 1 | 2 | 0
>>> + * 13 | 2 | -1 | 2
>>> + * 14 | 2 | 0 | 2
>>> + * 15 | 2 | 1 | 0
>>> + * 16 | 2 | 2 | -1
>>> + */
>>
>> Not sure what this case-table means...
>
> Sorry, because tree_entry_interesting_1() returns more than "match
> or not", we need to combine the result from positive pathspec with
> the negative one to correctly handle all_not_interesting and
> all_interesting. This table sums it up. I'll add more explanation
> in the next patch.
I managed to have guessed what the three columns on the right meant;
I was wondering about the meaning of the "#" column and where it is
defined/explained.
next prev parent reply other threads:[~2013-11-21 18:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-16 12:39 RFC: git bisect should accept "paths-to-be-excluded" Toralf Förster
2013-09-17 7:26 ` Christian Couder
2013-09-17 8:21 ` Matthieu Moy
2013-09-17 9:03 ` Christian Couder
2013-09-17 11:45 ` Duy Nguyen
2013-09-17 17:02 ` Junio C Hamano
2013-09-17 18:12 ` Piotr Krukowiecki
2013-09-17 19:04 ` Junio C Hamano
2013-09-17 19:41 ` Piotr Krukowiecki
2013-09-17 20:47 ` Junio C Hamano
2013-09-18 2:22 ` Duy Nguyen
2013-11-20 1:41 ` [PATCH] Support pathspec magic :(exclude) and its short form :- Nguyễn Thái Ngọc Duy
2013-11-20 23:48 ` Junio C Hamano
2013-11-21 2:10 ` Duy Nguyen
2013-11-21 18:43 ` Junio C Hamano [this message]
2013-09-17 16:23 ` RFC: git bisect should accept "paths-to-be-excluded" Toralf Förster
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=xmqqpppt4mur.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=toralf.foerster@gmx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).