Skip to content

Commit bff7df7

Browse files
stefanbellergitster
authored andcommitted
git-config: document accidental multi-line setting in deprecated syntax
The bug was noticed when writing the previous patch; a fix for this bug is not easy though: If we choose to ignore the case of the subsection (and revert most of the code of the previous patch, just keeping s/strncasecmp/strcmp/), then we'd introduce new sections using the new syntax, such that -------- [section.subsection] key = value1 -------- git config section.Subsection.key value2 would result in -------- [section.subsection] key = value1 [section.Subsection] key = value2 -------- which is even more confusing. A proper fix would replace the first occurrence of 'key'. As the syntax is deprecated, let's prefer to not 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]>
1 parent 2d84f13 commit bff7df7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Documentation/git-config.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,27 @@ http.sslverify false
430430

431431
include::config.txt[]
432432

433+
BUGS
434+
----
435+
When using the deprecated `[section.subsection]` syntax, changing a value
436+
will result in adding a multi-line key instead of a change, if the subsection
437+
is given with at least one uppercase character. For example when the config
438+
looks like
439+
440+
--------
441+
[section.subsection]
442+
key = value1
443+
--------
444+
445+
and running `git config section.Subsection.key value2` will result in
446+
447+
--------
448+
[section.subsection]
449+
key = value1
450+
key = value2
451+
--------
452+
453+
433454
GIT
434455
---
435456
Part of the linkgit:git[1] suite

0 commit comments

Comments
 (0)