Update Documentation/git-config to reflect --local option.
PATCH 1/1 Update Documentation/git-config to reflect --local option.
Describe config file selection in git-config. While the usage message of git-config shows --local, the documentation page did not contain anything about that.
---
This was pointed out in http://thread.gmane.org/gmane.comp.version-
control.git/196326
Documentation/git-config.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Documentation/git-config.txt +0 -0
@@ -44,10 +44,13 @@ a "true" or "false" string for bool), or '--path', which
does some
path expansion (see '--path' below). If no type specifier is passed, no checks or transformations are performed on the value.
-The file-option can be one of '--system', '--global' or '--file' +The file-option can be one of '--system', '--global', '--local', or '--file'
which specify where the values will be read from or written to. The default is to assume the config file of the current repository,
-.git/config unless defined otherwise with GIT_DIR and GIT_CONFIG +.git/config unless defined otherwise with GIT_DIR and GIT_CONFIG. +For read commands like '--get' the default is to search local, global, and +system config files (in this order) for the requested value and stop after +the first finding.
(see <<FILES>>).
This command will fail (with exit code ret) if:
Signature · 1 line
1.7.9.5
Quoted 8 lines · Florian Achleitner
Describe config file selection in git-config. While the usage message of git-config shows --local, the documentation page did not contain anything about that.
Signed-off-by Florian Achleitner <[email protected]>---
This was pointed out in http://thread.gmane.org/gmane.comp.version-
control.git/196326
Hrm, does the updated text explain the usefulness of the option clearly enough?
Peff> Original motivation is here:
Peff> http://thread.gmane.org/gmane.comp.version-control.git/152524
Review
Quoted 7 lines
(quoted diff) +5
-0+The file-option can be one of '--system', '--global', '--local', or '--file' which specify where the values will be read from or written to. The default is to assume the config file of the current repository, +.git/config unless defined otherwise with GIT_DIR and GIT_CONFIG. +For read commands like '--get' the default is to search local, global, and +system config files (in this order) for the requested value and stop after +the first finding.
It may be just me, but I find the untouched "The default is to assume" line somewhat out of place after this update. When reading, without any of the options, we read all three places and consolidate them (stopping after the first file that has the definition is a funny exception that "--get" does; in general the internals read all of them so "--get-all" output is a better way to understand what you wrote in your configuration files), and when writing, without any of the options, we write to the current configuration file.
The paragraph should first be restructured to describe read and write cases separately, and then '--local' should be described, perhaps like this?
When reading, the values are read from the system, global and repository local configuration files by default, and options '--system', '--global', '--local' and '--file <filename>' can be used to tell the command to read from only that location.
When writing, the new value is written to the repository local configuration file by default, and options '--system', '--global', '--file <filename>' can be used to tell the command to write to that location (you can say '--local' but that is the default).
(adding Jeff to cc)
Hi Florian and Junio,
Quoted 3 lines · Junio C Hamano
The paragraph should first be restructured to describe read and write cases separately, and then '--local' should be described, perhaps like this?
Thanks --- that makes a lot of sense to me.
Florian, would you be interested in another go? The usual convention in cases like this is to start the subject line with something like "[PATCH v2]" so it is clear which version of the patch is supposed to be better than the other.
Hope that helps,
Jonathan
PATCH v2 1/1 Update Documentation/git-config to reflect --local option.
Describe config file selection in git-config. While the usage message of git-config shows --local, the documentation page did not contain anything about that.
---
Updated with the formulation suggested by Junio.
Documentation/git-config.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
Documentation/git-config.txt +9 -5
@@ -44,11 +44,15 @@ a "true" or "false" string for bool), or '--path', which does some path expansion (see '--path' below). If no type specifier is passed, no checks or transformations are performed on the value. -The file-option can be one of '--system', '--global' or '--file' -which specify where the values will be read from or written to. -The default is to assume the config file of the current repository, -.git/config unless defined otherwise with GIT_DIR and GIT_CONFIG -(see <<FILES>>). +When reading, the values are read from the system, global and +repository local configuration files by default, and options +'--system', '--global', '--local' and '--file <filename>' can be +used to tell the command to read from only that location (see <<FILES>>). + +When writing, the new value is written to the repository local +configuration file by default, and options '--system', '--global', +'--file <filename>' can be used to tell the command to write to +that location (you can say '--local' but that is the default). This command will fail (with exit code ret) if:
Signature · 1 line
1.7.9.5