All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Update Documentation/git-config to reflect --local option.
@ 2012-05-03 22:44 Florian Achleitner
  2012-05-03 23:25 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Achleitner @ 2012-05-03 22:44 UTC (permalink / raw)
  To: git; +Cc: davidbarr, florian.achleitner.2.6.31, jrnieder

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 <florian.achleitner.2.6.31@gmail.com>
---
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(-)

diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 81b0398..bda8bbb 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -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:
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Update Documentation/git-config to reflect --local option.
  2012-05-03 22:44 [PATCH] Update Documentation/git-config to reflect --local option Florian Achleitner
@ 2012-05-03 23:25 ` Junio C Hamano
  2012-05-04  3:26   ` Jonathan Nieder
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2012-05-03 23:25 UTC (permalink / raw)
  To: Florian Achleitner; +Cc: git, davidbarr, florian.achleitner.2.6.31, jrnieder

Florian Achleitner <florian.achleitner2.6.31@gmail.com> writes:

> 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 <florian.achleitner.2.6.31@gmail.com>
> ---
> 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

> +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).

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Update Documentation/git-config to reflect --local option.
  2012-05-03 23:25 ` Junio C Hamano
@ 2012-05-04  3:26   ` Jonathan Nieder
  2012-05-05 10:03     ` [PATCH v2] " Florian Achleitner
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Nieder @ 2012-05-04  3:26 UTC (permalink / raw)
  To: Florian Achleitner; +Cc: Junio C Hamano, git, davidbarr, Jeff King

(adding Jeff to cc)
Hi Florian and Junio,

Junio C Hamano wrote:

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] Update Documentation/git-config to reflect --local option.
  2012-05-04  3:26   ` Jonathan Nieder
@ 2012-05-05 10:03     ` Florian Achleitner
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Achleitner @ 2012-05-05 10:03 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Junio C Hamano, git, davidbarr, Jeff King

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 <florian.achleitner.2.6.31@gmail.com>
---
Updated with the formulation suggested by Junio.

 Documentation/git-config.txt |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 81b0398..3f5d216 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -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:
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-05 10:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-03 22:44 [PATCH] Update Documentation/git-config to reflect --local option Florian Achleitner
2012-05-03 23:25 ` Junio C Hamano
2012-05-04  3:26   ` Jonathan Nieder
2012-05-05 10:03     ` [PATCH v2] " Florian Achleitner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.