This is a resend of sb/config-write-fix, with a slightly
better commit message and a renamed variable.
Thanks,
Stefan
Stefan Beller (3):
t1300: document current behavior of setting options
config: fix case sensitive subsection names on writing
git-config: document accidental multi-line setting in deprecated
syntax
Documentation/git-config.txt | 21 +++++++++
config.c | 12 ++++-
t/t1300-config.sh | 87 ++++++++++++++++++++++++++++++++++++
3 files changed, 119 insertions(+), 1 deletion(-)
./git-range-diff origin/sb/config-write-fix...HEAD >>0000-cover-letter.patch
2.18.0.597.ga71716f1ad-goog
1: 999d9026272 ! 1: e40f57f3da1 t1300: document current behavior of setting
options
@@ -7,7 +7,6 @@
for the follow up that will fix some issues with the current behavior.
Signed-off-by: Stefan Beller <[email protected]>
- Signed-off-by: Junio C Hamano <[email protected]>
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
--- a/t/t1300-config.sh
2: c667e555066 ! 2: f01cb1d9dae config: fix case sensitive subsection names
on writing
@@ -2,8 +2,8 @@
config: fix case sensitive subsection names on writing
- A use reported a submodule issue regarding strange case indentation
- issues, but it could be boiled down to the following test case:
+ A user reported a submodule issue regarding a section mix-up,
+ but it could be boiled down to the following test case:
$ git init test && cd test
$ git config foo."Bar".key test
@@ -32,7 +32,6 @@
Reported-by: JP Sugarbroad <[email protected]>
Signed-off-by: Stefan Beller <[email protected]>
- Signed-off-by: Junio C Hamano <[email protected]>
diff --git a/config.c b/config.c
--- a/config.c
@@ -41,7 +40,7 @@
int eof;
struct strbuf value;
struct strbuf var;
-+ unsigned section_name_old_dot_style : 1;
++ unsigned subsection_case_sensitive : 1;
int (*do_fgetc)(struct config_source *c);
int (*do_ungetc)(int c, struct config_source *conf);
@@ -49,7 +48,7 @@
static int get_extended_base_var(struct strbuf *name, int c)
{
-+ cf->section_name_old_dot_style = 0;
++ cf->subsection_case_sensitive = 0;
do {
if (c == '\n')
goto error_incomplete_line;
@@ -57,7 +56,7 @@
static int get_base_var(struct strbuf *name)
{
-+ cf->section_name_old_dot_style = 1;
++ cf->subsection_case_sensitive = 1;
for (;;) {
int c = get_next_char();
if (cf->eof)
@@ -70,7 +69,7 @@
if (cf->var.len < 2 || cf->var.buf[cf->var.len - 1] != '.')
return error("invalid section name '%s'", cf->var.buf);
-+ if (cf->section_name_old_dot_style)
++ if (cf->subsection_case_sensitive)
+ cmpfn = strncasecmp;
+ else
+ cmpfn = strncmp;
3: 6749bb283a8 ! 3: 6b5ad773490 git-config: document accidental multi-line
setting in deprecated syntax
@@ -29,7 +29,6 @@
spend time on fixing the behavior and just document it instead.
Signed-off-by: Stefan Beller <[email protected]>
- Signed-off-by: Junio C Hamano <[email protected]>
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
--- a/Documentation/git-config.txt