threads / patch / 26559

patchDocumentation: default -u<mode> is 'normal'

Subject: [PATCH] Documentation: default -u<mode> is 'normal'

## tl;dr

3 messages between Feb 19, 2011 and Feb 21, 2011. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Clemens Buchacher· Feb 19, 2011, 16:30 UTC · lore

git-commit's and git-status' default untracked status mode is 'normal', not 'all'.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
 Documentation/git-commit.txt |    2 +-
 Documentation/git-status.txt |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Show changes to 2 files +2 −2

Documentation/git-commit.txt, Documentation/git-status.txt

diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index b586c0f..b4e2f1b 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -214,7 +214,7 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].)
 
 -u[<mode>]::
 --untracked-files[=<mode>]::
-	Show untracked files (Default: 'all').
+	Show untracked files (Default: 'normal').
 +
 The mode parameter is optional, and is used to specify
 the handling of untracked files.
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index dae190a..369277a 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -38,7 +38,7 @@ OPTIONS
 
 -u[<mode>]::
 --untracked-files[=<mode>]::
-	Show untracked files (Default: 'all').
+	Show untracked files (Default: 'normal').
 +
 The mode parameter is optional, and is used to specify
 the handling of untracked files. The possible options are:
-- 
1.7.3.1.105.g84915
Junio C Hamano· Feb 21, 2011, 18:46 UTC · re: Clemens Buchacher · lore

Re: [PATCH] Documentation: default -u<mode> is 'normal'

Clemens Buchacher <drizzd@aon.at> writes:
> git-commit's and git-status' default untracked status mode is
> 'normal', not 'all'.
>
> Signed-off-by: Clemens Buchacher <drizzd@aon.at>

I wouldn't say there is no problem in this part of the documentation, but I think the "default" you are touching is not entirely incorrect. It is talking about what happens when you give only -u without saying <mode>, and I think <mode> _does_ default to 'all'.

When the command is _not_ given any "-u" option, the behaviour of it does default to "handle untracked files in the 'normal'" mode.

Show 8 quoted lines
> ...
>  -u[<mode>]::
>  --untracked-files[=<mode>]::
> -	Show untracked files (Default: 'all').
> +	Show untracked files (Default: 'normal').
>  +
>  The mode parameter is optional, and is used to specify
>  the handling of untracked files.
So either
	Show untracked files (<mode> defaults to 'all')
        The mode parameter is optional, and is used to specify the
        handling of untracked files; when -u is not used, the default is
        'normal', i.e. _show x and y and z_
(I'm too lazy to look x/y/z up, so please fill in the blanks).
or
	Show untracked files.
        The mode parameter is optional (defaults to 'all'), and is used to
        specify the handling of untracked files; when -u is not used, the
        default is 'normal', i.e. _show x and y and z_

I don't have a strong preference either way, but if I had to choose I probably would go with the latter.

Clemens Buchacher· Feb 21, 2011, 20:05 UTC · re: Junio C Hamano · lore

[PATCH] Documentation: clarify -u<mode> option defaults

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
Hi Junio,

Ok, with that we should be able to avoid any future confusion. Thanks for clarifying.

Clemens
 Documentation/git-commit.txt |   12 ++++++------
 Documentation/git-status.txt |   16 ++++++++--------
 2 files changed, 14 insertions(+), 14 deletions(-)
Show changes to 2 files +14 −12

Documentation/git-commit.txt, Documentation/git-status.txt

diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index b586c0f..8f89f6f 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -214,10 +214,11 @@ FROM UPSTREAM REBASE" section in linkgit:git-rebase[1].)
 
 -u[<mode>]::
 --untracked-files[=<mode>]::
-	Show untracked files (Default: 'all').
+	Show untracked files.
 +
-The mode parameter is optional, and is used to specify
-the handling of untracked files.
+The mode parameter is optional (defaults to 'all'), and is used to
+specify the handling of untracked files; when -u is not used, the
+default is 'normal', i.e. show untracked files and directories.
 +
 The possible options are:
 +
@@ -225,9 +226,8 @@ The possible options are:
 	- 'normal' - Shows untracked files and directories
 	- 'all'    - Also shows individual files in untracked directories.
 +
-See linkgit:git-config[1] for configuration variable
-used to change the default for when the option is not
-specified.
+The default can be changed using the status.showUntrackedFiles
+configuration variable documented in linkgit:git-config[1].
 
 -v::
 --verbose::
diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index dae190a..5102a23 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -38,20 +38,20 @@ OPTIONS
 
 -u[<mode>]::
 --untracked-files[=<mode>]::
-	Show untracked files (Default: 'all').
+	Show untracked files.
 +
-The mode parameter is optional, and is used to specify
-the handling of untracked files. The possible options are:
+The mode parameter is optional (defaults to 'all'), and is used to
+specify the handling of untracked files; when -u is not used, the
+default is 'normal', i.e. show untracked files and directories.
++
+The possible options are:
 +
---
 	- 'no'     - Show no untracked files
 	- 'normal' - Shows untracked files and directories
 	- 'all'    - Also shows individual files in untracked directories.
---
 +
-See linkgit:git-config[1] for configuration variable
-used to change the default for when the option is not
-specified.
+The default can be changed using the status.showUntrackedFiles
+configuration variable documented in linkgit:git-config[1].
 
 --ignore-submodules[=<when>]::
 	Ignore changes to submodules when looking for changes. <when> can be
-- 
1.7.3.1.105.g84915

← back to recent threads