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

Re: [GSoC PATCH 1/2] userdiff: add builtin driver for gitconfig syntax

From
Patrick Steinhardt <ps@pks.im>
Date
Mar 20, 2025, 08:38 UTC
Message-ID
<Z9vT-dqBzXxzXnlU@pks.im>
In-Reply-To
<20250319172016.2115-2-lucasseikioshiro@gmail.com>
On Wed, Mar 19, 2025 at 02:20:15PM -0300, Lucas Seiki Oshiro wrote:
Show 18 quoted lines
> From Documentation/config.adoc:
> 
> """
> The file consists of sections and variables. A section begins with
> the name of the section in square brackets and continues until the next
> section begins. Section names are case-insensitive. Only alphanumeric
> characters, `-` and `.` are allowed in section names. Each variable
> must belong to some section, which means that there must be a section
> header before the first setting of a variable.
> 
> [...]
> 
> Subsection names are case sensitive and can contain any characters except
> newline and the null byte.
> 
> The variable names are case-insensitive, allow only alphanumeric characters
> and `-`, and must start with an alphabetic character.
> """

I don't think it's necessary to quote this whole paragraph here, as most of us should be quite familiar with its format. I'd rather summarize the info a bit and explain how we can use the userdiff patterns for the general structure of the config. And in case there are any subtleties in the format it may make sense to specifically point out those instead of quoting the whole manual.

Show 6 quoted lines
> Then, add a new builtin driver for gitconfig files, where:
> 
> - the funcname regular expression matches sections and subsections,
>   i. e. the pattern [SECTION] or [SECTION "SUBSECTION"], where the
>   section is composed by alphanumeric numbers, `-` and `.`, and
>   subsection names may be composed by any characters;
Okay, makes sense.
> - word_regex is more permissive, matching any word with one or more
>   non-whitespace characters.

It would be nice to provide context _why_ it is more permissive and what the effect is.

The order of the commit message in our project is typically a bit different than what you have here: we first explain the actual problem that we aim to solve before discussing how you solve it.

The code change itself looks sensible to me.
Patrick
Previous: Lucas Seiki OshiroNext: D. Ben Knoble
Message 3 of 7 in “add userdiff driver for gitconfig”
  1. 0/2 add userdiff driver for gitconfigLucas Seiki Oshiro, Mar 19, 2025
  2. 1/2 userdiff: add builtin driver for gitconfig syntaxLucas Seiki Oshiro, Mar 19, 2025
  3. Patrick SteinhardtMar 20, 2025
  4. D. Ben KnobleMar 21, 2025
  5. 2/2 t4018: add tests for gitconfig in userdiffLucas Seiki Oshiro, Mar 19, 2025
  6. Patrick SteinhardtMar 20, 2025
  7. Lucas Seiki OshiroMar 23, 2025

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.