Sergei Organov | c1a95fa | 2007-11-15 16:19:29 +0300 | [diff] [blame] | 1 | // Please don't remove this comment as asciidoc behaves badly when |
| 2 | // the first non-empty line is ifdef/ifndef. The symptom is that |
| 3 | // without this comment the <git-diff-core> attribute conditionally |
| 4 | // defined below ends up being defined unconditionally. |
| 5 | // Last checked with asciidoc 7.0.2. |
| 6 | |
| 7 | ifndef::git-format-patch[] |
| 8 | ifndef::git-diff[] |
Miklos Vajna | 272bd3c | 2007-11-01 15:57:40 +0100 | [diff] [blame] | 9 | ifndef::git-log[] |
Sergei Organov | c1a95fa | 2007-11-15 16:19:29 +0300 | [diff] [blame] | 10 | :git-diff-core: 1 |
Miklos Vajna | 272bd3c | 2007-11-01 15:57:40 +0100 | [diff] [blame] | 11 | endif::git-log[] |
Sergei Organov | c1a95fa | 2007-11-15 16:19:29 +0300 | [diff] [blame] | 12 | endif::git-diff[] |
| 13 | endif::git-format-patch[] |
| 14 | |
| 15 | ifdef::git-format-patch[] |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 16 | -p:: |
Björn Gustavsson | 2cfa833 | 2009-11-07 10:58:55 +0100 | [diff] [blame] | 17 | --no-stat:: |
Björn Gustavsson | 02bc5b0 | 2009-11-07 10:51:56 +0100 | [diff] [blame] | 18 | Generate plain patches without any diffstats. |
Sergei Organov | c1a95fa | 2007-11-15 16:19:29 +0300 | [diff] [blame] | 19 | endif::git-format-patch[] |
| 20 | |
| 21 | ifndef::git-format-patch[] |
| 22 | -p:: |
jidanni@jidanni.org | a9e67c8 | 2008-12-29 15:03:17 +0800 | [diff] [blame] | 23 | -u:: |
Will Palmer | 1c9eecf | 2010-05-13 09:59:00 +0100 | [diff] [blame] | 24 | --patch:: |
Sergei Organov | c1a95fa | 2007-11-15 16:19:29 +0300 | [diff] [blame] | 25 | Generate patch (see section on generating patches). |
| 26 | {git-diff? This is the default.} |
| 27 | endif::git-format-patch[] |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 28 | |
Robin Rosenberg | 4eb9947 | 2007-07-25 12:08:17 +0200 | [diff] [blame] | 29 | -U<n>:: |
Robin Rosenberg | 4eb9947 | 2007-07-25 12:08:17 +0200 | [diff] [blame] | 30 | --unified=<n>:: |
| 31 | Generate diffs with <n> lines of context instead of |
Björn Gustavsson | 02bc5b0 | 2009-11-07 10:51:56 +0100 | [diff] [blame] | 32 | the usual three. |
| 33 | ifndef::git-format-patch[] |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 34 | Implies `-p`. |
Björn Gustavsson | 02bc5b0 | 2009-11-07 10:51:56 +0100 | [diff] [blame] | 35 | endif::git-format-patch[] |
Robin Rosenberg | 4eb9947 | 2007-07-25 12:08:17 +0200 | [diff] [blame] | 36 | |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 37 | ifndef::git-format-patch[] |
Junio C Hamano | b537664 | 2006-07-07 05:28:05 -0700 | [diff] [blame] | 38 | --raw:: |
| 39 | Generate the raw format. |
Sergei Organov | c1a95fa | 2007-11-15 16:19:29 +0300 | [diff] [blame] | 40 | {git-diff-core? This is the default.} |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 41 | endif::git-format-patch[] |
Junio C Hamano | b537664 | 2006-07-07 05:28:05 -0700 | [diff] [blame] | 42 | |
Björn Gustavsson | 02bc5b0 | 2009-11-07 10:51:56 +0100 | [diff] [blame] | 43 | ifndef::git-format-patch[] |
Petr Baudis | 5c91da2 | 2006-04-11 13:22:17 +0200 | [diff] [blame] | 44 | --patch-with-raw:: |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 45 | Synonym for `-p --raw`. |
Björn Gustavsson | 02bc5b0 | 2009-11-07 10:51:56 +0100 | [diff] [blame] | 46 | endif::git-format-patch[] |
Petr Baudis | 5c91da2 | 2006-04-11 13:22:17 +0200 | [diff] [blame] | 47 | |
Teemu Likonen | ec74042 | 2009-01-25 14:20:22 +0200 | [diff] [blame] | 48 | --patience:: |
Johannes Schindelin | 34292bd | 2009-01-01 17:39:17 +0100 | [diff] [blame] | 49 | Generate a diff using the "patience diff" algorithm. |
| 50 | |
Linus Torvalds | 5c5b2ea | 2006-09-28 15:07:16 -0700 | [diff] [blame] | 51 | --stat[=width[,name-width]]:: |
| 52 | Generate a diffstat. You can override the default |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 53 | output width for 80-column terminal by `--stat=width`. |
Linus Torvalds | 5c5b2ea | 2006-09-28 15:07:16 -0700 | [diff] [blame] | 54 | The width of the filename part can be controlled by |
| 55 | giving another width to it separated by a comma. |
Johannes Schindelin | d75f795 | 2006-04-14 00:15:30 +0200 | [diff] [blame] | 56 | |
Junio C Hamano | 74e2abe | 2006-10-12 03:01:00 -0700 | [diff] [blame] | 57 | --numstat:: |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 58 | Similar to `\--stat`, but shows number of added and |
Junio C Hamano | 74e2abe | 2006-10-12 03:01:00 -0700 | [diff] [blame] | 59 | deleted lines in decimal notation and pathname without |
Junio C Hamano | 2f89543 | 2006-12-26 00:15:26 -0800 | [diff] [blame] | 60 | abbreviation, to make it more machine friendly. For |
| 61 | binary files, outputs two `-` instead of saying |
| 62 | `0 0`. |
Junio C Hamano | 74e2abe | 2006-10-12 03:01:00 -0700 | [diff] [blame] | 63 | |
Nicolas Pitre | ebd124c | 2006-12-14 23:15:44 -0500 | [diff] [blame] | 64 | --shortstat:: |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 65 | Output only the last line of the `--stat` format containing total |
Nicolas Pitre | ebd124c | 2006-12-14 23:15:44 -0500 | [diff] [blame] | 66 | number of modified files, as well as number of added and deleted |
| 67 | lines. |
| 68 | |
Gerrit Pape | 37152d8 | 2008-04-21 18:15:52 +0000 | [diff] [blame] | 69 | --dirstat[=limit]:: |
Heikki Orsila | 62e00b0 | 2008-09-01 03:50:28 +0300 | [diff] [blame] | 70 | Output the distribution of relative amount of changes (number of lines added or |
| 71 | removed) for each sub-directory. Directories with changes below |
| 72 | a cut-off percent (3% by default) are not shown. The cut-off percent |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 73 | can be set with `--dirstat=limit`. Changes in a child directory is not |
| 74 | counted for the parent directory, unless `--cumulative` is used. |
Gerrit Pape | 37152d8 | 2008-04-21 18:15:52 +0000 | [diff] [blame] | 75 | |
Heikki Orsila | fd33777 | 2008-09-05 22:27:35 +0300 | [diff] [blame] | 76 | --dirstat-by-file[=limit]:: |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 77 | Same as `--dirstat`, but counts changed files instead of lines. |
Heikki Orsila | fd33777 | 2008-09-05 22:27:35 +0300 | [diff] [blame] | 78 | |
Sean | 4bbd261 | 2006-05-14 08:13:49 -0400 | [diff] [blame] | 79 | --summary:: |
| 80 | Output a condensed summary of extended header information |
| 81 | such as creations, renames and mode changes. |
| 82 | |
Björn Gustavsson | 02bc5b0 | 2009-11-07 10:51:56 +0100 | [diff] [blame] | 83 | ifndef::git-format-patch[] |
Johannes Schindelin | 2935327 | 2006-04-15 13:41:18 +0200 | [diff] [blame] | 84 | --patch-with-stat:: |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 85 | Synonym for `-p --stat`. |
Björn Gustavsson | 02bc5b0 | 2009-11-07 10:51:56 +0100 | [diff] [blame] | 86 | endif::git-format-patch[] |
Johannes Schindelin | 2935327 | 2006-04-15 13:41:18 +0200 | [diff] [blame] | 87 | |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 88 | ifndef::git-format-patch[] |
Björn Gustavsson | 64485b4 | 2009-11-22 20:43:20 +0100 | [diff] [blame] | 89 | |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 90 | -z:: |
Björn Gustavsson | 5c931c8 | 2009-11-23 08:40:24 +0100 | [diff] [blame] | 91 | ifdef::git-log[] |
| 92 | Separate the commits with NULs instead of with new newlines. |
| 93 | + |
| 94 | Also, when `--raw` or `--numstat` has been given, do not munge |
| 95 | pathnames and use NULs as output field terminators. |
| 96 | endif::git-log[] |
Björn Gustavsson | 64485b4 | 2009-11-22 20:43:20 +0100 | [diff] [blame] | 97 | ifndef::git-log[] |
Charles Bailey | 03aa87e | 2010-04-18 19:28:17 +0100 | [diff] [blame] | 98 | When `--raw`, `--numstat`, `--name-only` or `--name-status` has been |
| 99 | given, do not munge pathnames and use NULs as output field terminators. |
Björn Gustavsson | 5c931c8 | 2009-11-23 08:40:24 +0100 | [diff] [blame] | 100 | endif::git-log[] |
Björn Gustavsson | 64485b4 | 2009-11-22 20:43:20 +0100 | [diff] [blame] | 101 | + |
| 102 | Without this option, each pathname output will have TAB, LF, double quotes, |
| 103 | and backslash characters replaced with `\t`, `\n`, `\"`, and `\\`, |
| 104 | respectively, and the pathname will be enclosed in double quotes if |
| 105 | any of those replacements occurred. |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 106 | |
| 107 | --name-only:: |
| 108 | Show only names of changed files. |
| 109 | |
Junio C Hamano | 946f5f7 | 2005-09-21 00:20:06 -0700 | [diff] [blame] | 110 | --name-status:: |
Miklos Vajna | a6f47b2 | 2008-04-22 14:23:48 +0200 | [diff] [blame] | 111 | Show only names and status of changed files. See the description |
| 112 | of the `--diff-filter` option on what the status letters mean. |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 113 | |
Johannes Schindelin | 752c0c2 | 2009-10-19 14:38:32 +0200 | [diff] [blame] | 114 | --submodule[=<format>]:: |
| 115 | Chose the output format for submodule differences. <format> can be one of |
| 116 | 'short' and 'log'. 'short' just shows pairs of commit names, this format |
| 117 | is used when this option is not given. 'log' is the default value for this |
| 118 | option and lists the commits in that commit range like the 'summary' |
| 119 | option of linkgit:git-submodule[1] does. |
| 120 | |
Mark Lodato | 73e9da0 | 2010-02-16 23:55:58 -0500 | [diff] [blame] | 121 | --color[=<when>]:: |
Junio C Hamano | b537664 | 2006-07-07 05:28:05 -0700 | [diff] [blame] | 122 | Show colored diff. |
Mark Lodato | 73e9da0 | 2010-02-16 23:55:58 -0500 | [diff] [blame] | 123 | The value must be always (the default), never, or auto. |
Junio C Hamano | b537664 | 2006-07-07 05:28:05 -0700 | [diff] [blame] | 124 | |
| 125 | --no-color:: |
| 126 | Turn off colored diff, even when the configuration file |
| 127 | gives the default to color output. |
Mark Lodato | 73e9da0 | 2010-02-16 23:55:58 -0500 | [diff] [blame] | 128 | Same as `--color=never`. |
Junio C Hamano | b537664 | 2006-07-07 05:28:05 -0700 | [diff] [blame] | 129 | |
Thomas Rast | 882749a | 2010-04-14 17:59:06 +0200 | [diff] [blame] | 130 | --word-diff[=<mode>]:: |
| 131 | Show a word diff, using the <mode> to delimit changed words. |
| 132 | By default, words are delimited by whitespace; see |
| 133 | `--word-diff-regex` below. The <mode> defaults to 'plain', and |
| 134 | must be one of: |
Johannes Schindelin | 2b6a541 | 2009-01-17 17:29:45 +0100 | [diff] [blame] | 135 | + |
Thomas Rast | 882749a | 2010-04-14 17:59:06 +0200 | [diff] [blame] | 136 | -- |
| 137 | color:: |
| 138 | Highlight changed words using only colors. Implies `--color`. |
| 139 | plain:: |
| 140 | Show words as `[-removed-]` and `{+added+}`. Makes no |
| 141 | attempts to escape the delimiters if they appear in the input, |
| 142 | so the output may be ambiguous. |
| 143 | porcelain:: |
| 144 | Use a special line-based format intended for script |
| 145 | consumption. Added/removed/unchanged runs are printed in the |
| 146 | usual unified diff format, starting with a `+`/`-`/` ` |
| 147 | character at the beginning of the line and extending to the |
| 148 | end of the line. Newlines in the input are represented by a |
| 149 | tilde `~` on a line of its own. |
| 150 | none:: |
| 151 | Disable word diff again. |
| 152 | -- |
| 153 | + |
| 154 | Note that despite the name of the first mode, color is used to |
| 155 | highlight the changed parts in all modes if enabled. |
| 156 | |
| 157 | --word-diff-regex=<regex>:: |
| 158 | Use <regex> to decide what a word is, instead of considering |
| 159 | runs of non-whitespace to be a word. Also implies |
| 160 | `--word-diff` unless it was already enabled. |
| 161 | + |
| 162 | Every non-overlapping match of the |
Thomas Rast | c4b252c | 2009-01-17 17:29:47 +0100 | [diff] [blame] | 163 | <regex> is considered a word. Anything between these matches is |
| 164 | considered whitespace and ignored(!) for the purposes of finding |
| 165 | differences. You may want to append `|[^[:space:]]` to your regular |
| 166 | expression to make sure that it matches all non-whitespace characters. |
| 167 | A match that contains a newline is silently truncated(!) at the |
| 168 | newline. |
Thomas Rast | 80c49c3 | 2009-01-17 17:29:48 +0100 | [diff] [blame] | 169 | + |
Boyd Stephen Smith Jr | 98a4d87 | 2009-01-20 21:46:57 -0600 | [diff] [blame] | 170 | The regex can also be set via a diff driver or configuration option, see |
| 171 | linkgit:gitattributes[1] or linkgit:git-config[1]. Giving it explicitly |
| 172 | overrides any diff driver or configuration setting. Diff drivers |
| 173 | override configuration settings. |
Thomas Rast | 882749a | 2010-04-14 17:59:06 +0200 | [diff] [blame] | 174 | |
| 175 | --color-words[=<regex>]:: |
| 176 | Equivalent to `--word-diff=color` plus (if a regex was |
| 177 | specified) `--word-diff-regex=<regex>`. |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 178 | endif::git-format-patch[] |
Johannes Schindelin | f59a59e | 2006-07-28 23:56:15 +0200 | [diff] [blame] | 179 | |
Junio C Hamano | b537664 | 2006-07-07 05:28:05 -0700 | [diff] [blame] | 180 | --no-renames:: |
| 181 | Turn off rename detection, even when the configuration |
| 182 | file gives the default to do so. |
| 183 | |
Björn Gustavsson | 02bc5b0 | 2009-11-07 10:51:56 +0100 | [diff] [blame] | 184 | ifndef::git-format-patch[] |
Bill Lear | 16507fc | 2007-01-27 07:21:53 -0600 | [diff] [blame] | 185 | --check:: |
| 186 | Warn if changes introduce trailing whitespace |
Wincent Colaiuta | 62c6489 | 2007-12-13 21:24:52 +0100 | [diff] [blame] | 187 | or an indent that uses a space before a tab. Exits with |
| 188 | non-zero status if problems are found. Not compatible with |
| 189 | --exit-code. |
Björn Gustavsson | 02bc5b0 | 2009-11-07 10:51:56 +0100 | [diff] [blame] | 190 | endif::git-format-patch[] |
Bill Lear | 16507fc | 2007-01-27 07:21:53 -0600 | [diff] [blame] | 191 | |
Junio C Hamano | 80b1e51 | 2005-11-14 17:53:22 -0800 | [diff] [blame] | 192 | --full-index:: |
Jim Meyering | 6457e58 | 2008-07-02 09:49:59 +0200 | [diff] [blame] | 193 | Instead of the first handful of characters, show the full |
| 194 | pre- and post-image blob object names on the "index" |
| 195 | line when generating patch format output. |
Junio C Hamano | b537664 | 2006-07-07 05:28:05 -0700 | [diff] [blame] | 196 | |
| 197 | --binary:: |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 198 | In addition to `--full-index`, output a binary diff that |
| 199 | can be applied with `git-apply`. |
Junio C Hamano | 80b1e51 | 2005-11-14 17:53:22 -0800 | [diff] [blame] | 200 | |
Junio C Hamano | 913419f | 2005-12-18 02:03:15 -0800 | [diff] [blame] | 201 | --abbrev[=<n>]:: |
Junio C Hamano | 47dd0d5 | 2005-12-13 17:21:41 -0800 | [diff] [blame] | 202 | Instead of showing the full 40-byte hexadecimal object |
| 203 | name in diff-raw format output and diff-tree header |
Jon Loeliger | 323b9db | 2009-01-12 14:02:07 -0600 | [diff] [blame] | 204 | lines, show only a partial prefix. This is |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 205 | independent of the `--full-index` option above, which controls |
Junio C Hamano | 913419f | 2005-12-18 02:03:15 -0800 | [diff] [blame] | 206 | the diff-patch output format. Non default number of |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 207 | digits can be specified with `--abbrev=<n>`. |
Junio C Hamano | 47dd0d5 | 2005-12-13 17:21:41 -0800 | [diff] [blame] | 208 | |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 209 | -B:: |
| 210 | Break complete rewrite changes into pairs of delete and create. |
| 211 | |
| 212 | -M:: |
Jeff King | 7ffad25 | 2010-05-08 00:44:34 -0400 | [diff] [blame] | 213 | ifndef::git-log[] |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 214 | Detect renames. |
Jeff King | 7ffad25 | 2010-05-08 00:44:34 -0400 | [diff] [blame] | 215 | endif::git-log[] |
| 216 | ifdef::git-log[] |
| 217 | If generating diffs, detect and report renames for each commit. |
| 218 | For following files across renames while traversing history, see |
| 219 | `--follow`. |
| 220 | endif::git-log[] |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 221 | |
| 222 | -C:: |
Johannes Schindelin | ca6c097 | 2007-06-11 21:12:19 +0100 | [diff] [blame] | 223 | Detect copies as well as renames. See also `--find-copies-harder`. |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 224 | |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 225 | ifndef::git-format-patch[] |
Jon Loeliger | 147cf31 | 2006-02-09 09:12:11 -0600 | [diff] [blame] | 226 | --diff-filter=[ACDMRTUXB*]:: |
| 227 | Select only files that are Added (`A`), Copied (`C`), |
| 228 | Deleted (`D`), Modified (`M`), Renamed (`R`), have their |
Junio C Hamano | f07c3c5 | 2008-10-18 08:20:51 -0700 | [diff] [blame] | 229 | type (i.e. regular file, symlink, submodule, ...) changed (`T`), |
| 230 | are Unmerged (`U`), are |
Jon Loeliger | 147cf31 | 2006-02-09 09:12:11 -0600 | [diff] [blame] | 231 | Unknown (`X`), or have had their pairing Broken (`B`). |
| 232 | Any combination of the filter characters may be used. |
| 233 | When `*` (All-or-none) is added to the combination, all |
| 234 | paths are selected if there is any file that matches |
| 235 | other criteria in the comparison; if there is no file |
| 236 | that matches other criteria, nothing is selected. |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 237 | endif::git-format-patch[] |
Jon Loeliger | 147cf31 | 2006-02-09 09:12:11 -0600 | [diff] [blame] | 238 | |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 239 | --find-copies-harder:: |
Johannes Schindelin | ca6c097 | 2007-06-11 21:12:19 +0100 | [diff] [blame] | 240 | For performance reasons, by default, `-C` option finds copies only |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 241 | if the original file of the copy was modified in the same |
Christian Meder | f73ae1f | 2005-10-05 15:08:26 -0700 | [diff] [blame] | 242 | changeset. This flag makes the command |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 243 | inspect unmodified files as candidates for the source of |
| 244 | copy. This is a very expensive operation for large |
Johannes Schindelin | ca6c097 | 2007-06-11 21:12:19 +0100 | [diff] [blame] | 245 | projects, so use it with caution. Giving more than one |
| 246 | `-C` option has the same effect. |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 247 | |
Junio C Hamano | 8082d8d | 2005-09-21 00:18:27 -0700 | [diff] [blame] | 248 | -l<num>:: |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 249 | The `-M` and `-C` options require O(n^2) processing time where n |
Christian Meder | f73ae1f | 2005-10-05 15:08:26 -0700 | [diff] [blame] | 250 | is the number of potential rename/copy targets. This |
Junio C Hamano | 8082d8d | 2005-09-21 00:18:27 -0700 | [diff] [blame] | 251 | option prevents rename/copy detection from running if |
Christian Meder | f73ae1f | 2005-10-05 15:08:26 -0700 | [diff] [blame] | 252 | the number of rename/copy targets exceeds the specified |
Junio C Hamano | 8082d8d | 2005-09-21 00:18:27 -0700 | [diff] [blame] | 253 | number. |
| 254 | |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 255 | ifndef::git-format-patch[] |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 256 | -S<string>:: |
Jeff King | 821d56a | 2009-03-03 10:40:41 -0500 | [diff] [blame] | 257 | Look for differences that introduce or remove an instance of |
| 258 | <string>. Note that this is different than the string simply |
| 259 | appearing in diff output; see the 'pickaxe' entry in |
| 260 | linkgit:gitdiffcore[7] for more details. |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 261 | |
| 262 | --pickaxe-all:: |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 263 | When `-S` finds a change, show all the changes in that |
Christian Meder | f73ae1f | 2005-10-05 15:08:26 -0700 | [diff] [blame] | 264 | changeset, not just the files that contain the change |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 265 | in <string>. |
| 266 | |
Petr Baudis | d01d8c6 | 2006-03-29 02:16:33 +0200 | [diff] [blame] | 267 | --pickaxe-regex:: |
| 268 | Make the <string> not a plain string but an extended POSIX |
| 269 | regex to match. |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 270 | endif::git-format-patch[] |
Petr Baudis | d01d8c6 | 2006-03-29 02:16:33 +0200 | [diff] [blame] | 271 | |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 272 | -O<orderfile>:: |
| 273 | Output the patch in the order specified in the |
| 274 | <orderfile>, which has one shell glob pattern per line. |
| 275 | |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 276 | ifndef::git-format-patch[] |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 277 | -R:: |
Lukas_Sandström | 5f3aa19 | 2005-11-11 02:12:27 +0100 | [diff] [blame] | 278 | Swap two inputs; that is, show differences from index or |
Junio C Hamano | dda2d79 | 2005-07-13 12:52:35 -0700 | [diff] [blame] | 279 | on-disk file to tree contents. |
| 280 | |
Junio C Hamano | c0cb4a0 | 2008-02-13 00:34:39 -0800 | [diff] [blame] | 281 | --relative[=<path>]:: |
Junio C Hamano | cd676a5 | 2008-02-12 14:26:02 -0800 | [diff] [blame] | 282 | When run from a subdirectory of the project, it can be |
| 283 | told to exclude changes outside the directory and show |
Junio C Hamano | c0cb4a0 | 2008-02-13 00:34:39 -0800 | [diff] [blame] | 284 | pathnames relative to it with this option. When you are |
| 285 | not in a subdirectory (e.g. in a bare repository), you |
| 286 | can name which subdirectory to make the output relative |
| 287 | to by giving a <path> as an argument. |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 288 | endif::git-format-patch[] |
Junio C Hamano | cd676a5 | 2008-02-12 14:26:02 -0800 | [diff] [blame] | 289 | |
jidanni@jidanni.org | a9e67c8 | 2008-12-29 15:03:17 +0800 | [diff] [blame] | 290 | -a:: |
Stephan Feder | d507bb1 | 2006-07-07 15:57:09 +0200 | [diff] [blame] | 291 | --text:: |
| 292 | Treat all files as text. |
| 293 | |
Junio C Hamano | a44a0c9 | 2007-02-14 00:41:32 -0800 | [diff] [blame] | 294 | --ignore-space-at-eol:: |
Wincent Colaiuta | 0ac7903 | 2007-12-12 09:12:01 +0100 | [diff] [blame] | 295 | Ignore changes in whitespace at EOL. |
Junio C Hamano | a44a0c9 | 2007-02-14 00:41:32 -0800 | [diff] [blame] | 296 | |
jidanni@jidanni.org | a9e67c8 | 2008-12-29 15:03:17 +0800 | [diff] [blame] | 297 | -b:: |
Jakub Narebski | 8ebe185 | 2006-12-03 17:24:41 +0100 | [diff] [blame] | 298 | --ignore-space-change:: |
Wincent Colaiuta | 0ac7903 | 2007-12-12 09:12:01 +0100 | [diff] [blame] | 299 | Ignore changes in amount of whitespace. This ignores whitespace |
| 300 | at line end, and considers all other sequences of one or |
| 301 | more whitespace characters to be equivalent. |
Jakub Narebski | 8ebe185 | 2006-12-03 17:24:41 +0100 | [diff] [blame] | 302 | |
jidanni@jidanni.org | a9e67c8 | 2008-12-29 15:03:17 +0800 | [diff] [blame] | 303 | -w:: |
Jakub Narebski | 8ebe185 | 2006-12-03 17:24:41 +0100 | [diff] [blame] | 304 | --ignore-all-space:: |
Wincent Colaiuta | 0ac7903 | 2007-12-12 09:12:01 +0100 | [diff] [blame] | 305 | Ignore whitespace when comparing lines. This ignores |
| 306 | differences even if one line has whitespace where the other |
Jakub Narebski | 8ebe185 | 2006-12-03 17:24:41 +0100 | [diff] [blame] | 307 | line has none. |
| 308 | |
René Scharfe | 6d0e674 | 2008-12-28 19:45:32 +0100 | [diff] [blame] | 309 | --inter-hunk-context=<lines>:: |
| 310 | Show the context between diff hunks, up to the specified number |
| 311 | of lines, thereby fusing hunks that are close to each other. |
| 312 | |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 313 | ifndef::git-format-patch[] |
Alex Riesen | 41bbf9d | 2007-03-14 01:17:04 +0100 | [diff] [blame] | 314 | --exit-code:: |
| 315 | Make the program exit with codes similar to diff(1). |
| 316 | That is, it exits with 1 if there were differences and |
| 317 | 0 means no differences. |
| 318 | |
Alex Riesen | 2a18c26 | 2007-03-25 01:55:43 +0100 | [diff] [blame] | 319 | --quiet:: |
Björn Gustavsson | dce5ef1 | 2009-11-07 10:53:07 +0100 | [diff] [blame] | 320 | Disable all output of the program. Implies `--exit-code`. |
Björn Gustavsson | d4cb003 | 2009-11-07 10:52:29 +0100 | [diff] [blame] | 321 | endif::git-format-patch[] |
Alex Riesen | 2a18c26 | 2007-03-25 01:55:43 +0100 | [diff] [blame] | 322 | |
Johannes Schindelin | 72909be | 2007-06-30 18:47:07 +0100 | [diff] [blame] | 323 | --ext-diff:: |
| 324 | Allow an external diff helper to be executed. If you set an |
Dan McGee | 5162e69 | 2007-12-29 00:20:38 -0600 | [diff] [blame] | 325 | external diff driver with linkgit:gitattributes[5], you need |
| 326 | to use this option with linkgit:git-log[1] and friends. |
Johannes Schindelin | 72909be | 2007-06-30 18:47:07 +0100 | [diff] [blame] | 327 | |
| 328 | --no-ext-diff:: |
| 329 | Disallow external diff drivers. |
| 330 | |
Jens Lehmann | dd44d41 | 2010-06-08 18:31:51 +0200 | [diff] [blame] | 331 | --ignore-submodules[=<when>]:: |
| 332 | Ignore changes to submodules in the diff generation. <when> can be |
Jens Lehmann | aee9c7d | 2010-08-06 00:39:25 +0200 | [diff] [blame] | 333 | either "none", "untracked", "dirty" or "all", which is the default |
| 334 | Using "none" will consider the submodule modified when it either contains |
| 335 | untracked or modified files or its HEAD differs from the commit recorded |
| 336 | in the superproject and can be used to override any settings of the |
Jens Lehmann | 302ad7a | 2010-08-06 00:40:48 +0200 | [diff] [blame^] | 337 | 'ignore' option in linkgit:git-config[1] or linkgit:gitmodules[5]. When |
Jens Lehmann | dd44d41 | 2010-06-08 18:31:51 +0200 | [diff] [blame] | 338 | "untracked" is used submodules are not considered dirty when they only |
| 339 | contain untracked content (but they are still scanned for modified |
| 340 | content). Using "dirty" ignores all changes to the work tree of submodules, |
| 341 | only changes to the commits stored in the superproject are shown (this was |
| 342 | the behavior until 1.7.0). Using "all" hides all changes to submodules. |
Johannes Schindelin | 50fd9bd | 2008-05-14 18:03:31 +0100 | [diff] [blame] | 343 | |
Johannes Schindelin | eab9a40 | 2007-12-18 19:32:14 +0000 | [diff] [blame] | 344 | --src-prefix=<prefix>:: |
| 345 | Show the given source prefix instead of "a/". |
| 346 | |
| 347 | --dst-prefix=<prefix>:: |
| 348 | Show the given destination prefix instead of "b/". |
| 349 | |
| 350 | --no-prefix:: |
| 351 | Do not show any source or destination prefix. |
| 352 | |
Junio C Hamano | 8db9307 | 2005-08-30 13:51:01 -0700 | [diff] [blame] | 353 | For more detailed explanation on these common options, see also |
Jonathan Nieder | 6998e4d | 2008-06-30 17:01:21 -0500 | [diff] [blame] | 354 | linkgit:gitdiffcore[7]. |