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

RE: [PATCH] config: add an includeIf.env{Exists,Bool,Is,Match}

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
Sep 27, 2021, 21:56 UTC
Message-ID
<00f701d7b3ea$7eb59eb0$7c20dc10$@nexbridge.com>
In-Reply-To
<YVI5rYamHBkGQ/jy@coredump.intra.peff.net>
On September 27, 2021 5:38 PM, Jeff King wrote:
Show 22 quoted lines
>Subject: Re: [PATCH] config: add an includeIf.env{Exists,Bool,Is,Match}
>
>On Mon, Sep 27, 2021 at 04:53:59PM -0400, Randall S. Becker wrote:
>
>> What about something like:
>>
>> 	[includeIf "env:PATH ~= '^(.*😊)/usr/bin(:.*)*$' "]
>>
>> Using single quotes and a full regex pattern instead of trying to
>> provide a syntax to extract a pattern and then match. One call to
>> regexec() would be easier. Then escaping is regcomp's problem
>> (mostly). Potentially, you could even remove the outer ", but that
>> would be wonky. You could omit the ^ and $ by default assuming a full
>> match.
>
>I almost suggested that, but then...how do you put single-quotes in your pattern? You can backslash-escape them, but:
>
>  - do you need to escape the backslash to get it through the config
>    parser intact?
>
>  - it seems extra funny to me because single quotes usually imply a
>    lack of interpolation
Exactly so. I think it would be more clear to have a regular expression be provided literally without interpretation other than by regcomp - other than the emergency ' escape, of course.
Previous: Jeff KingNext: Ævar Arnfjörð Bjarmason
Message 14 of 23 in “ANSI sequences produced on non-ANSI terminal”
  1. The Grey WolfSep 23, 2021
  2. Jeff KingSep 23, 2021
  3. Junio C HamanoSep 23, 2021
  4. Randall S. BeckerSep 23, 2021
  5. Kevin DaudtSep 25, 2021
  6. config: add an includeIf.env{Exists,Bool,Is,Match}Ævar Arnfjörð Bjarmason, Sep 24, 2021
  7. Jeff KingSep 24, 2021
  8. Junio C HamanoSep 24, 2021
  9. Jeff KingSep 24, 2021
  10. Junio C HamanoSep 27, 2021
  11. Jeff KingSep 27, 2021
  12. Randall S. BeckerSep 27, 2021
  13. Jeff KingSep 27, 2021
  14. Randall S. BeckerSep 27, 2021
  15. Ævar Arnfjörð BjarmasonSep 27, 2021
  16. Jeff KingSep 28, 2021
  17. Ævar Arnfjörð BjarmasonSep 28, 2021
  18. Jeff KingSep 28, 2021
  19. Ævar Arnfjörð BjarmasonSep 28, 2021
  20. Junio C HamanoSep 28, 2021
  21. GreywolfSep 24, 2021
  22. Jeff KingSep 25, 2021
  23. GreywolfOct 1, 2021

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.