@matheusbsbs / matheus-bagliano / commits / 8273c79ae2
Fork 0

war on whitespaces: documentation.

We were missing the --whitespace option in the usage string for git-apply and git-am, so this commit adds them. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Mar 2, 2006 at 00:45 UTC 8273c79ae2e6b782dba3dccb815b386cc83e4294
4 files changed +40 -4
Documentation/git-am.txt
+7 -2
@@ -9,7 +9,8 @@ git-am - Apply a series of patches in a mailbox
9 SYNOPSIS
10 --------
11 [verse]
12 -'git-am' [--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>...
12 +'git-am' [--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way]
13 + [--interactive] [--whitespace=<option>] <mbox>...
14 'git-am' [--skip | --resolved]
15
16 DESCRIPTION
@@ -46,6 +47,10 @@ OPTIONS
47 Skip the current patch. This is only meaningful when
48 restarting an aborted patch.
49
50 +--whitespace=<option>::
51 + This flag is passed to the `git-apply` program that applies
52 + the patch.
53 +
54 --interactive::
55 Run interactively, just like git-applymbox.
56
@@ -80,7 +85,7 @@ names.
85
86 SEE ALSO
87 --------
83 -gitlink:git-applymbox[1], gitlink:git-applypatch[1].
88 +gitlink:git-applymbox[1], gitlink:git-applypatch[1], gitlink:git-apply[1].
89
90
91 Author
Documentation/git-apply.txt
+30
@@ -11,6 +11,7 @@ SYNOPSIS
11 [verse]
12 'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply]
13 [--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM]
14 + [--whitespace=<nowarn|warn|error|error-all|strip>]
15 [<patch>...]
16
17 DESCRIPTION
@@ -97,6 +98,35 @@ OPTIONS
98 result. This allows binary files to be patched in a
99 very limited way.
100
101 +--whitespace=<option>::
102 + When applying a patch, detect a new or modified line
103 + that ends with trailing whitespaces (this includes a
104 + line that solely consists of whitespaces). By default,
105 + the command outputs warning messages and applies the
106 + patch.
107 + When `git-apply` is used for statistics and not applying a
108 + patch, it defaults to `nowarn`.
109 + You can use different `<option>` to control this
110 + behaviour:
111 ++
112 +* `nowarn` turns off the trailing whitespace warning.
113 +* `warn` outputs warnings for a few such errors, but applies the
114 + patch (default).
115 +* `error` outputs warnings for a few such errors, and refuses
116 + to apply the patch.
117 +* `error-all` is similar to `error` but shows all errors.
118 +* `strip` outputs warnings for a few such errors, strips out the
119 + trailing whitespaces and applies the patch.
120 +
121 +
122 +Configuration
123 +-------------
124 +
125 +apply.whitespace::
126 + When no `--whitespace` flag is given from the command
127 + line, this configuration item is used as the default.
128 +
129 +
130 Author
131 ------
132 Written by Linus Torvalds <torvalds@osdl.org>
apply.c
+1 -1
@@ -32,7 +32,7 @@ static int no_add = 0;
32 static int show_index_info = 0;
33 static int line_termination = '\n';
34 static const char apply_usage[] =
35 -"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM] <patch>...";
35 +"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM] [--whitespace=<nowarn|warn|error|error-all|strip>] <patch>...";
36
37 static enum whitespace_eol {
38 nowarn_whitespace,
git-am.sh
+2 -1
@@ -2,7 +2,8 @@
2 #
3 # Copyright (c) 2005, 2006 Junio C Hamano
4
5 -USAGE='[--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>
5 +USAGE='[--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way]
6 + [--interactive] [--whitespace=<option>] <mbox>...
7 or, when resuming [--skip | --resolved]'
8 . git-sh-setup
9