@matheusbsbs / matheus-bagliano / commits / 5684ed6d32
Fork 0

git-apply(1): document missing options and improve existing ones

Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jonas Fonseca committed Aug 25, 2006 at 02:56 UTC 5684ed6d32fdb953e3b318333ed84ed245f2f6b0
1 file changed +39 -7
Documentation/git-apply.txt
+39 -7
@@ -10,9 +10,10 @@ SYNOPSIS
10 --------
11 [verse]
12 'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply]
13 - [--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM]
14 - [-CNUM] [--whitespace=<nowarn|warn|error|error-all|strip>]
15 - [<patch>...]
13 + [--no-add] [--index-info] [--allow-binary-replacement | --binary]
14 + [-R | --reverse] [--reject] [-z] [-pNUM] [-CNUM] [--inaccurate-eof]
15 + [--whitespace=<nowarn|warn|error|error-all|strip>] [--exclude=PATH]
16 + [--cached] [--verbose] [<patch>...]
17
18 DESCRIPTION
19 -----------
@@ -55,6 +56,11 @@ OPTIONS
56 up-to-date, it is flagged as an error. This flag also
57 causes the index file to be updated.
58
59 +--cached::
60 + Apply a patch without touching the working tree. Instead, take the
61 + cached data, apply the patch, and store the result in the index,
62 + without using the working tree. This implies '--index'.
63 +
64 --index-info::
65 Newer git-diff output has embedded 'index information'
66 for each blob to help identify the original version that
@@ -62,6 +68,16 @@ OPTIONS
68 the original version of the blob is available locally,
69 outputs information about them to the standard output.
70
71 +-R, --reverse::
72 + Apply the patch in reverse.
73 +
74 +--reject::
75 + For atomicity, gitlink:git-apply[1] by default fails the whole patch and
76 + does not touch the working tree when some of the hunks
77 + do not apply. This option makes it apply
78 + the parts of the patch that are applicable, and send the
79 + rejected hunks to the standard output of the command.
80 +
81 -z::
82 When showing the index information, do not munge paths,
83 but use NUL terminated machine readable format. Without
@@ -80,8 +96,8 @@ OPTIONS
96 ever ignored.
97
98 --apply::
83 - If you use any of the options marked ``Turns off
84 - "apply"'' above, git-apply reads and outputs the
99 + If you use any of the options marked "Turns off
100 + 'apply'" above, gitlink:git-apply[1] reads and outputs the
101 information you asked without actually applying the
102 patch. Give this flag after those flags to also apply
103 the patch.
@@ -93,7 +109,7 @@ OPTIONS
109 the result with this option, which would apply the
110 deletion part but not addition part.
111
96 ---allow-binary-replacement::
112 +--allow-binary-replacement, --binary::
113 When applying a patch, which is a git-enhanced patch
114 that was prepared to record the pre- and post-image object
115 name in full, and the path being patched exactly matches
@@ -104,13 +120,18 @@ OPTIONS
120 result. This allows binary files to be patched in a
121 very limited way.
122
123 +--exclude=<path-pattern>::
124 + Don't apply changes to files matching the given path pattern. This can
125 + be useful when importing patchsets, where you want to exclude certain
126 + files or directories.
127 +
128 --whitespace=<option>::
129 When applying a patch, detect a new or modified line
130 that ends with trailing whitespaces (this includes a
131 line that solely consists of whitespaces). By default,
132 the command outputs warning messages and applies the
133 patch.
113 - When `git-apply` is used for statistics and not applying a
134 + When gitlink:git-apply[1] is used for statistics and not applying a
135 patch, it defaults to `nowarn`.
136 You can use different `<option>` to control this
137 behavior:
@@ -124,6 +145,17 @@ OPTIONS
145 * `strip` outputs warnings for a few such errors, strips out the
146 trailing whitespaces and applies the patch.
147
148 +--inacurate-eof::
149 + Under certain circumstances, some versions of diff do not correctly
150 + detect a missing new-line at the end of the file. As a result, patches
151 + created by such diff programs do not record incomplete lines
152 + correctly. This option adds support for applying such patches by
153 + working around this bug.
154 +
155 +--verbose::
156 + Report progress to stderr. By default, only a message about the
157 + current patch being applied will be printed. This option will cause
158 + additional information to be reported.
159
160 Configuration
161 -------------