From: Stefan Beller <sbeller@google.com>
To: Ramsay Jones <ramsay@ramsayjones.plus.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Duy Nguyen <pclouds@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [RFC/PATCH] pathspec: allow escaped query values
Date: Wed, 1 Jun 2016 19:20:39 -0700 [thread overview]
Message-ID: <CAGZ79kZSB-r-GzS1WVtLk-sX068PDXQ1h-1FV-8YZFGGsr3hWQ@mail.gmail.com> (raw)
In-Reply-To: <574F800D.6070107@ramsayjones.plus.com>
On Wed, Jun 1, 2016 at 5:38 PM, Ramsay Jones
<ramsay@ramsayjones.plus.com> wrote:
>
>
> On 02/06/16 00:52, Stefan Beller wrote:
>> In our own .gitattributes file we have attributes such as:
>>
>> *.[ch] whitespace=indent,trail,space
>>
>> When querying for attributes we want to be able to ask for the exact
>> value, i.e.
>>
>> git ls-files :(attr:whitespace=indent,trail,space)
>>
>> should work, but the commas are used in the attr magic to introduce
>> the next attr, such that this query currently fails with
>>
>> fatal: Invalid pathspec magic 'trail' in ':(attr:whitespace=indent,trail,space)'
>>
>> This change allows escaping characters by a backslash, such that the query
>>
>> git ls-files :(attr:whitespace=indent\,trail\,space)
>
> Not having given this much thought at all, but the question which comes
> to mind is: can you use some other separator for the <attr>-s rather than
> a comma? That way you don't need to quote them in the <value> part of the
> <attr>-spec.
>
> (I dunno, maybe use ; or : instead?)
That was essentially my proposal as well (just that I said "white
spaces" instead if ':' or ';'),
but it is not a good idea according to Junio as we don't want to need
knowledge of the attr
syntax here in the pathspec matching IIUC. We rather want "I want to
transport this exact
string for the match, but to go through the pathspec magic, we need to
apply escaping of
the exact string. That way we can change the attr system later without
having to worry
about the syntax replacements done in the pathspecs.
>
> ATB,
> Ramsay Jones
>
>
>
next prev parent reply other threads:[~2016-06-02 2:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 23:52 [RFC/PATCH] pathspec: allow escaped query values Stefan Beller
2016-06-02 0:33 ` Junio C Hamano
2016-06-02 2:23 ` Stefan Beller
2016-06-02 0:38 ` Ramsay Jones
2016-06-02 2:20 ` Stefan Beller [this message]
2016-06-02 5:46 ` Junio C Hamano
2016-06-02 15:30 ` Ramsay Jones
2016-06-02 16:10 ` Junio C Hamano
2016-06-02 18:42 ` Ramsay Jones
2016-06-02 18:58 ` Junio C Hamano
2016-06-02 19:29 ` Junio C Hamano
2016-06-02 19:52 ` Ramsay Jones
2016-06-02 19:04 ` Stefan Beller
2016-06-02 19:44 ` Ramsay Jones
2016-06-02 19:46 ` Junio C Hamano
2016-06-02 19:53 ` Ramsay Jones
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=CAGZ79kZSB-r-GzS1WVtLk-sX068PDXQ1h-1FV-8YZFGGsr3hWQ@mail.gmail.com \
--to=sbeller@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
--cc=ramsay@ramsayjones.plus.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).