Skip to content

pr-796/derrickstolee/maintenance/config-v2

As reported [1], 'git maintenance unregister' fails when a repository is
located in a directory with regex glob characters.

[1]
https://lore.kernel.org/git/2c2db228-069a-947d-8446-89f4d3f6181a@gmail.com/T/#mb96fa4187a0d6aeda097cd95804a8aafc0273022

The discussed solution was to modify 'git config' to specify that the
'value_regex' argument should be treated as an exact string match. This is
the primary change in this series, with an additional patch at the end to
make 'git maintenance [un]register' use this option, when necessary.

Updates in V2
=============

 * Updated the test structure for the new tests in t1300-config.sh

 * Renamed option from '--literal-value' to '--fixed-value'

 * Use 'unsigned flags' instead of 'int flags'. This changes more prototypes
   than before.

 * Move flag definitions closer to method declarations.

 * Test the uses of --fixed-value to reject when value_regex is missing.

Thanks, -Stolee

Derrick Stolee (7):
  t1300: test "set all" mode with value_regex
  t1300: add test for --replace-all with value_regex
  config: convert multi_replace to flags
  config: add --fixed-value option, un-implemented
  config: plumb --fixed-value into config API
  config: implement --fixed-value with --get*
  maintenance: use 'git config --fixed-value'

 Documentation/git-config.txt |  20 +++--
 builtin/branch.c             |   4 +-
 builtin/config.c             |  59 +++++++++++---
 builtin/gc.c                 |   5 +-
 builtin/remote.c             |   8 +-
 config.c                     |  29 ++++---
 config.h                     |  36 +++++++--
 t/t1300-config.sh            | 148 +++++++++++++++++++++++++++++++++++
 t/t7900-maintenance.sh       |  12 +++
 9 files changed, 278 insertions(+), 43 deletions(-)

base-commit: 0016b618182f642771dc589cf0090289f9fe1b4f

Submitted-As: https://lore.kernel.org/git/pull.796.v2.git.1606147507.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.796.git.1605801143.gitgitgadget@gmail.com
Assets 2