From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Duy Nguyen <pclouds@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCHv9 4/4] pathspec: allow querying for attributes
Date: Fri, 20 May 2016 11:21:40 -0700 [thread overview]
Message-ID: <CAGZ79kZOmo6hh_trBJ_H5QRWgAxbP4JUu_KBUKeeKL1XsAwiOQ@mail.gmail.com> (raw)
In-Reply-To: <xmqqd1ogegtn.fsf@gitster.mtv.corp.google.com>
On Fri, May 20, 2016 at 11:15 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Stefan Beller <sbeller@google.com> writes:
>>
>>> +attr;;
>>> +After `attr:` comes a space separated list of "attribute
>>> +...
>>> ++
>>
>> The text looks OK, but does it format well?
>
> I didn't check this, but the remainder would look like this
> squashable patch.
I checked and it looks wrong. the "exclude" section is indented below
the new attr section
fix is:
--8<--
diff --git a/Documentation/glossary-content.txt
b/Documentation/glossary-content.txt
index e06520b..181f52e 100644
--- a/Documentation/glossary-content.txt
+++ b/Documentation/glossary-content.txt
@@ -389,7 +389,7 @@ After `attr:` comes a space separated list of "attribute
requirements", all of which must be met in order for the
path to be considered a match; this is in addition to the
usual non-magic pathspec pattern matching.
-
++
Each of the attribute requirements for the path takes one of
these forms:
--8<--
I can resend with your proposed fixes as well.
Thanks,
Stefan
>
> You seem to i18ngrep for "fatal" but we are using test_must_fail for
> the exit status, so I am not sure if that adds much value, so the
> additional tests here do nto use that pattern.
>
> diff --git a/pathspec.c b/pathspec.c
> index 693a5e7..0a02255 100644
> --- a/pathspec.c
> +++ b/pathspec.c
> @@ -115,19 +115,19 @@ static void parse_pathspec_attr_match(struct pathspec_item *item, const char *va
> const char *attr = si->string;
> struct attr_match *am = &item->attr_match[j];
>
> - attr_len = strcspn(attr, "=");
> switch (*attr) {
> case '!':
> am->match_mode = MATCH_UNSPECIFIED;
> attr++;
> - attr_len--;
> + attr_len = strlen(attr);
> break;
> case '-':
> am->match_mode = MATCH_UNSET;
> attr++;
> - attr_len--;
> + attr_len = strlen(attr);
> break;
> default:
> + attr_len = strcspn(attr, "=");
> if (attr[attr_len] != '=')
> am->match_mode = MATCH_SET;
> else {
> diff --git a/t/t6134-pathspec-with-labels.sh b/t/t6134-pathspec-with-labels.sh
> index 5da1a63..060047a 100755
> --- a/t/t6134-pathspec-with-labels.sh
> +++ b/t/t6134-pathspec-with-labels.sh
> @@ -160,4 +160,9 @@ test_expect_success 'abort on giving invalid label on the command line' '
> test_i18ngrep "fatal" actual
> '
>
> +test_expect_success 'abort on asking for wrong magic' '
> + test_must_fail git ls-files . ":(attr:-label=foo)" &&
> + test_must_fail git ls-files . ":(attr:!label=foo)"
> +'
> +
> test_done
next prev parent reply other threads:[~2016-05-20 18:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-19 23:23 [PATCHv9 0/4] pathspec magic extension to search for attributes Stefan Beller
2016-05-19 23:23 ` [PATCHv9 1/4] Documentation: fix a typo Stefan Beller
2016-05-19 23:23 ` [PATCHv9 2/4] pathspec: move long magic parsing out of prefix_pathspec Stefan Beller
2016-05-19 23:23 ` [PATCHv9 3/4] pathspec: move prefix check out of the inner loop Stefan Beller
2016-05-19 23:23 ` [PATCHv9 4/4] pathspec: allow querying for attributes Stefan Beller
2016-05-19 23:32 ` Junio C Hamano
2016-05-20 18:15 ` Junio C Hamano
2016-05-20 18:21 ` Stefan Beller [this message]
2016-05-20 18:31 ` 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=CAGZ79kZOmo6hh_trBJ_H5QRWgAxbP4JUu_KBUKeeKL1XsAwiOQ@mail.gmail.com \
--to=sbeller@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--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 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).