diff options
author | Brandon Williams <bmwill@google.com> | 2017-03-13 11:23:22 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-13 15:28:56 -0700 |
commit | c5af19f9ab4cd8582689ca9d9c84f188f4442d10 (patch) | |
tree | f148fdc5c2b8d223227a6328dc3cb53c8c06dd7e /builtin/count-objects.c | |
parent | pathspec: allow querying for attributes (diff) | |
download | tgif-c5af19f9ab4cd8582689ca9d9c84f188f4442d10.tar.xz |
pathspec: allow escaped query values
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)
will match all path that have the value "indent,trail,space" for the
whitespace attribute. To accomplish this, we need to modify two places.
First `parse_long_magic` needs to not stop early upon seeing a comma or
closing paren that is escaped. As a second step we need to remove any
escaping from the attr value.
Based on a patch by Stefan Beller <sbeller@google.com>
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/count-objects.c')
0 files changed, 0 insertions, 0 deletions