Skip to content

Commit a171dac

Browse files
committed
doc: add shortcut to "am --whitespace=<action>"
We refer readers of "git am --help" to "git apply --help" for many options that are passed through, and most of them are simple booleans, but --whitespace takes from a set of actions whose names may slip users' minds. Give a list of them in "git am --help" to reduce one level of redirection only to find out what they are. In the helper function to parse the available options, there was a helpful comment reminding the developer to update list of <action>s in the completion script. Mention the two documentation pages there as well. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 61a22dd commit a171dac

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Documentation/git-am.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ include::rerere-options.txt[]
128128
These flags are passed to the 'git apply' (see linkgit:git-apply[1])
129129
program that applies
130130
the patch.
131+
+
132+
Valid <action> for the `--whitespace` option are:
133+
`nowarn`, `warn`, `fix`, `error`, and `error-all`.
131134

132135
--patch-format::
133136
By default the command will try to detect the patch format

apply.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ static int parse_whitespace_option(struct apply_state *state, const char *option
7878
return 0;
7979
}
8080
/*
81-
* Please update $__git_whitespacelist in git-completion.bash
81+
* Please update $__git_whitespacelist in git-completion.bash,
82+
* Documentation/git-apply.txt, and Documentation/git-am.txt
8283
* when you add new options.
8384
*/
8485
return error(_("unrecognized whitespace option '%s'"), option);

0 commit comments

Comments
 (0)