git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH 3/3] list-objects-filter: implement composite filters

From
Matthew DeVore <matvore@comcast.net>
Date
May 20, 2019, 18:28 UTC
Message-ID
<CDE68B7A-C621-4CA8-8039-C432ACBC4FE4@comcast.net>
In-Reply-To
<1E174CAA-BD57-400B-A83B-4AABFAFBC04B@comcast.net>
Show 8 quoted lines
> On 2019/05/17, at 6:17, Matthew DeVore <matvore@comcast.net> wrote:
> 
> We do have to require the combine operator (& or +) and % be encoded. For other operators, there are three options:
> 
> ...
> 3. Require encoding of a couple of "reserved" characters that don't appear in filters now, and don't typically appear in UNIX path names. This would allow for expansion later. For instance, "~&%*+|(){}!\" plus the ASCII range [0, 0x20] and single and double quotes - do not allow encoding of anything else.
> 
> 4. Same requirements as 3, but permit encoding of other arbitrary characters.

I tried implementing the reserved characters idea, and considering that it was a small amount of code, I think it's worth it:

+static const char *RESERVED_NON_WS = "\"\\'[]{}!@#$^~*+";
+
+static int has_reserved_character(
+       struct strbuf *sub_spec, struct strbuf *errbuf)
+{
+       const char *c = sub_spec->buf;
+       while (*c) {
+               if (*c <= ' ' || *strchr(RESERVED_NON_WS, *c))
+                       goto found_reserved;
+               c++;
+       }
+
+       return 0;
+
+found_reserved:
+       if (errbuf)
+               strbuf_addf(errbuf, "must escape char in sub-spec: %c", *c);
+       return 1;
+}
+
Previous: Matthew DeVoreNext: Jonathan Tan
Message 21 of 23 in “Proposal: object negotiation for partial clones”
  1. Matthew DeVoreApr 28, 2019
  2. Jonathan NiederMay 6, 2019
  3. Jonathan TanMay 6, 2019
  4. Jonathan NiederMay 6, 2019
  5. Matthew DeVoreMay 6, 2019
  6. Jonathan NiederMay 7, 2019
  7. Matthew DeVoreMay 6, 2019
  8. Jonathan TanMay 7, 2019
  9. Matthew DeVoreMay 7, 2019
  10. Jonathan TanMay 9, 2019
  11. Matthew DeVoreMay 14, 2019
  12. Jonathan NiederMay 14, 2019
  13. 0/3 implement composite filtersMatthew DeVore, May 16, 2019
  14. 1/3 list-objects-filter: refactor into a context structMatthew DeVore, May 16, 2019
  15. 2/3 list-objects-filter-options: error is localizeableMatthew DeVore, May 16, 2019
  16. 3/3 list-objects-filter: implement composite filtersMatthew DeVore, May 16, 2019
  17. Junio C HamanoMay 17, 2019
  18. Matthew DeVoreMay 17, 2019
  19. Junio C HamanoMay 19, 2019
  20. Matthew DeVoreMay 20, 2019
  21. Matthew DeVoreMay 20, 2019
  22. Jonathan TanMay 16, 2019
  23. Matthew DeVoreMay 17, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.