Skip to content

pr-796/derrickstolee/maintenance/config-v3

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.

While we're here, let's rename 'value_regex' to 'value_pattern' to make
things a bit clearer.

Updates in V3
=============

 * Renamed 'value_regex' to 'value_pattern' in code and 'value-pattern' in
   docs (except po/)

 * Reordered commits slightly to help with that rename.

 * Updated tests to use 'test_when_finished rm -f ...'

 * Changed all references to "glob" characters to "meta" characters.

 * Several other test modifications. Thanks, Emily, for the review!

Thanks, -Stolee

P.S. Happy Thanksgiving to those celebrating!

Derrick Stolee (8):
  config: convert multi_replace to flags
  config: replace 'value_regex' with 'value_pattern'
  t1300: test "set all" mode with value-pattern
  t1300: add test for --replace-all with value-pattern
  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 |  26 +++---
 builtin/branch.c             |   4 +-
 builtin/config.c             |  81 +++++++++++++++----
 builtin/gc.c                 |   5 +-
 builtin/remote.c             |   8 +-
 config.c                     |  75 ++++++++++--------
 config.h                     |  36 +++++++--
 t/t1300-config.sh            | 149 +++++++++++++++++++++++++++++++++++
 t/t7900-maintenance.sh       |  12 +++
 9 files changed, 321 insertions(+), 75 deletions(-)

base-commit: 0016b618182f642771dc589cf0090289f9fe1b4f

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