Skip to content

config: fix case sensitive subsection names on writing

Stefan Beller git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3t1300: document current behavior of setting optionst/t1300-config.sh+86 -00 replies
1/3t1300: document current behavior of setting optionst/t1300-config.sh+86 -00 replies
1/3t1300: document current behavior of setting optionst/t1300-config.sh+86 -00 replies
2/3config: fix case sensitive subsection names on writingconfig.c t/t1300-config.sh+4 -11 reply
2/3config: fix case sensitive subsection names on writingconfig.c t/t1300-config.sh+12 -15 replies
2/3config: fix case sensitive subsection names on writingconfig.c t/t1300-config.sh+12 -10 replies
3/3config: treat section case insensitive in store_aux_eventconfig.c+15 -10 replies
3/3git-config: document accidental multi-line setting in deprecated syntaxDocumentation/git-config.txt+21 -00 replies
3/3git-config: document accidental multi-line setting in deprecated syntaxDocumentation/git-config.txt+21 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] config: fix case sensitive subsection names on writing
Quoted 4 lines · Johannes Schindelin

Thanks for the patch!

The only thing that was not clear to me from the patch and from the commit message was: the first part *is* case insensitive, right?

right.

Quoted 3 lines

How does the
patch take care of that? Is it relying on git_config_parse_key() to do that? If so, I don't see it...

It turns out it doesn't quite do that;
The parsing code takes the old notation into account and translates any
[V.A]

    r = ...

into a lower cased "v.a." for ease of comparison. That happens in get_base_var, which would call further into get_extended_base_var if the new notation is used.

The code in store_aux_event however is written without the consideration of the old code and has no way of knowing the capitalization of the section or subsection (which were forced to lowercase in the old dot notation).

So either we have to do some major surgery, or the old notation gets some regression while fixing the new notation.

Quoted 7 lines
Quoted 2 lines

I would still hold the judgment on "all except only this one" myself. That's a bit too early in my mind.

Agreed. I seem to remember that I had a funny problem "in the reverse", where http.<url>.* is case-sensitive, but in an unexpected way: if the URL contains upper-case characters, the <url> part of the config key needs to be downcased, otherwise the setting won't be picked up.

I wrote some patches that show more of what is happening.

I suggest to drop the last patch and only take the first two, or if we decide we want to be fully correct, we'd want to discuss how to make it happen. (where to store the information that we are dealing with an old notation)

Thanks,
Stefan

Stefan Beller (3):
t1300: document current behavior of setting options
config: fix case sensitive subsection names on writing
config: treat section case insensitive in store_aux_event

 config.c          | 16 ++++++++-
 t/t1300-config.sh | 89 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+), 1 deletion(-)
Signature · 1 line
2.18.0.132.g195c49a2227