]> git.99rst.org Git - git.git/commit
userdiff: add builtin driver for INI files
authorLucas Seiki Oshiro <redacted>
Mon, 31 Mar 2025 03:13:09 +0000 (00:13 -0300)
committerJunio C Hamano <redacted>
Tue, 1 Apr 2025 10:02:09 +0000 (03:02 -0700)
commit43380056df44aed6e074689dc8bc940f9dc6e2c8
treeba5279cfaa2f82baceadb3b65d7c20d002952ca0
parent683c54c999c301c2cd6f715c411407c413b1d84e
userdiff: add builtin driver for INI files

Add a new builtin driver for generic INI files (e. g. the gitconfig
files), where:

- the funcname regular expression matches section names, i. e. any
  string between brackets at the beginning of the line, with or without
  indentation;

- word_regex matches any word with one or more non-whitespace
  characters without checking if it is a valid variable name or value.

Also add tests for the new userdiff driver. These files define sections
and subsections, with and without indentation.

Helped-by: Patrick Steinhardt <redacted>
Helped-by: D. Ben Knoble <redacted>
Signed-off-by: Lucas Seiki Oshiro <redacted>
Signed-off-by: Junio C Hamano <redacted>
t/t4018/ini-section [new file with mode: 0644]
t/t4018/ini-section-noindent [new file with mode: 0644]
t/t4018/ini-section-same-line [new file with mode: 0644]
t/t4018/ini-subsection [new file with mode: 0644]
t/t4018/ini-subsection-noindent [new file with mode: 0644]
userdiff.c
git clone https://git.99rst.org/PROJECT