* "git cvsserver" can be run via "git shell".
+ * "git cvsserver" acts more like receive-pack by running post-receive
+ and post-update hooks.
+
* "git am" and "git rebase" are far less verbose.
* "git pull" learned to pass --[no-]ff option to underlying "git
* "git fast-export" produces datastream that can be fed to fast-import
to reproduce the history recorded in a git repository.
+ * "git add -i" takes pathspecs to limit the set of files to work on.
+
+ * "git add -p" is a short-hand to go directly to the selective patch
+ subcommand in the interactive command loop and to exit when done.
+
+ * "git add -i" UI has been colorized.
+
* "git commit --allow-empty" allows you to create a single-parent
commit that records the same tree as its parent, overriding the usual
safety valve.
* "git commit --amend" can amend a merge that does not change the tree
from its first parent.
+ * "git commit" has been rewritten in C.
+
* "git stash random-text" does not create a new stash anymore. It was
a UI mistake. Use "git stash save random-text", or "git stash"
(without extra args) for that.
* "git svn" talking with the SVN over http will correctly quote branch
and project names.
+ * "git config" did not work correctly on platforms that define
+ REG_NOMATCH to an even number.
+
--
exec >/var/tmp/1
-O=v1.5.3.7-1003-gf38ca7c
+O=v1.5.3.7-1111-gd9f4059
echo O=`git describe refs/heads/master`
git shortlog --no-merges $O..refs/heads/master ^refs/heads/maint
whitespace). The values of these variables may be specified as
in color.branch.<slot>.
+color.interactive::
+ When set to `always`, always use colors in `git add --interactive`.
+ When false (or `never`), never. When set to `true` or `auto`, use
+ colors only when the output is to the terminal. Defaults to false.
+
+color.interactive.<slot>::
+ Use customized color for `git add --interactive`
+ output. `<slot>` may be `prompt`, `header`, or `help`, for
+ three distinct types of normal output from interactive
+ programs. The values of these variables may be specified as
+ in color.branch.<slot>.
+
color.pager::
A boolean to enable/disable colored output when the pager is in
use (default is true).
all parents.
-Generating patches with -p
---------------------------
-
-When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
-with a '-p' option, or "git diff" without the '--raw' option, they
-do not produce the output described above; instead they produce a
-patch file. You can customize the creation of such patches via the
-GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.
-
-What the -p option produces is slightly different from the traditional
-diff format.
-
-1. It is preceded with a "git diff" header, that looks like
- this:
-
- diff --git a/file1 b/file2
-+
-The `a/` and `b/` filenames are the same unless rename/copy is
-involved. Especially, even for a creation or a deletion,
-`/dev/null` is _not_ used in place of `a/` or `b/` filenames.
-+
-When rename/copy is involved, `file1` and `file2` show the
-name of the source file of the rename/copy and the name of
-the file that rename/copy produces, respectively.
-
-2. It is followed by one or more extended header lines:
-
- old mode <mode>
- new mode <mode>
- deleted file mode <mode>
- new file mode <mode>
- copy from <path>
- copy to <path>
- rename from <path>
- rename to <path>
- similarity index <number>
- dissimilarity index <number>
- index <hash>..<hash> <mode>
-
-3. TAB, LF, double quote and backslash characters in pathnames
- are represented as `\t`, `\n`, `\"` and `\\`, respectively.
- If there is need for such substitution then the whole
- pathname is put in double quotes.
-
-The similarity index is the percentage of unchanged lines, and
-the dissimilarity index is the percentage of changed lines. It
-is a rounded down integer, followed by a percent sign. The
-similarity index value of 100% is thus reserved for two equal
-files, while 100% dissimilarity means that no line from the old
-file made it into the new one.
-
-
-combined diff format
---------------------
-
-"git-diff-tree", "git-diff-files" and "git-diff" can take '-c' or
-'--cc' option to produce 'combined diff', which looks like this:
-
-------------
-diff --combined describe.c
-index fabadb8,cc95eb0..4866510
---- a/describe.c
-+++ b/describe.c
-@@@ -98,20 -98,12 +98,20 @@@
- return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
- }
-
-- static void describe(char *arg)
- -static void describe(struct commit *cmit, int last_one)
-++static void describe(char *arg, int last_one)
- {
- + unsigned char sha1[20];
- + struct commit *cmit;
- struct commit_list *list;
- static int initialized = 0;
- struct commit_name *n;
-
- + if (get_sha1(arg, sha1) < 0)
- + usage(describe_usage);
- + cmit = lookup_commit_reference(sha1);
- + if (!cmit)
- + usage(describe_usage);
- +
- if (!initialized) {
- initialized = 1;
- for_each_ref(get_name);
-------------
-
-1. It is preceded with a "git diff" header, that looks like
- this (when '-c' option is used):
-
- diff --combined file
-+
-or like this (when '--cc' option is used):
-
- diff --c file
-
-2. It is followed by one or more extended header lines
- (this example shows a merge with two parents):
-
- index <hash>,<hash>..<hash>
- mode <mode>,<mode>..<mode>
- new file mode <mode>
- deleted file mode <mode>,<mode>
-+
-The `mode <mode>,<mode>..<mode>` line appears only if at least one of
-the <mode> is different from the rest. Extended headers with
-information about detected contents movement (renames and
-copying detection) are designed to work with diff of two
-<tree-ish> and are not used by combined diff format.
-
-3. It is followed by two-line from-file/to-file header
-
- --- a/file
- +++ b/file
-+
-Similar to two-line header for traditional 'unified' diff
-format, `/dev/null` is used to signal created or deleted
-files.
-
-4. Chunk header format is modified to prevent people from
- accidentally feeding it to `patch -p1`. Combined diff format
- was created for review of merge commit changes, and was not
- meant for apply. The change is similar to the change in the
- extended 'index' header:
-
- @@@ <from-file-range> <from-file-range> <to-file-range> @@@
-+
-There are (number of parents + 1) `@` characters in the chunk
-header for combined diff format.
-
-Unlike the traditional 'unified' diff format, which shows two
-files A and B with a single column that has `-` (minus --
-appears in A but removed in B), `+` (plus -- missing in A but
-added to B), or `" "` (space -- unchanged) prefix, this format
-compares two or more files file1, file2,... with one file X, and
-shows how X differs from each of fileN. One column for each of
-fileN is prepended to the output line to note how X's line is
-different from it.
-
-A `-` character in the column N means that the line appears in
-fileN but it does not appear in the result. A `+` character
-in the column N means that the line appears in the last file,
-and fileN does not have that line (in other words, the line was
-added, from the point of view of that parent).
-
-In the above example output, the function signature was changed
-from both files (hence two `-` removals from both file1 and
-file2, plus `++` to mean one line that was added does not appear
-in either file1 nor file2). Also two other lines are the same
-from file1 but do not appear in file2 (hence prefixed with ` +`).
-
-When shown by `git diff-tree -c`, it compares the parents of a
-merge commit with the merge result (i.e. file1..fileN are the
-parents). When shown by `git diff-files -c`, it compares the
-two unresolved merge parents with the working tree file
-(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
-"their version").
+include::diff-generate-patch.txt[]
--- /dev/null
+Generating patches with -p
+--------------------------
+
+When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
+with a '-p' option, "git diff" without the '--raw' option, or
+"git log" with the "-p" option, they
+do not produce the output described above; instead they produce a
+patch file. You can customize the creation of such patches via the
+GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.
+
+What the -p option produces is slightly different from the traditional
+diff format.
+
+1. It is preceded with a "git diff" header, that looks like
+ this:
+
+ diff --git a/file1 b/file2
++
+The `a/` and `b/` filenames are the same unless rename/copy is
+involved. Especially, even for a creation or a deletion,
+`/dev/null` is _not_ used in place of `a/` or `b/` filenames.
++
+When rename/copy is involved, `file1` and `file2` show the
+name of the source file of the rename/copy and the name of
+the file that rename/copy produces, respectively.
+
+2. It is followed by one or more extended header lines:
+
+ old mode <mode>
+ new mode <mode>
+ deleted file mode <mode>
+ new file mode <mode>
+ copy from <path>
+ copy to <path>
+ rename from <path>
+ rename to <path>
+ similarity index <number>
+ dissimilarity index <number>
+ index <hash>..<hash> <mode>
+
+3. TAB, LF, double quote and backslash characters in pathnames
+ are represented as `\t`, `\n`, `\"` and `\\`, respectively.
+ If there is need for such substitution then the whole
+ pathname is put in double quotes.
+
+The similarity index is the percentage of unchanged lines, and
+the dissimilarity index is the percentage of changed lines. It
+is a rounded down integer, followed by a percent sign. The
+similarity index value of 100% is thus reserved for two equal
+files, while 100% dissimilarity means that no line from the old
+file made it into the new one.
+
+
+combined diff format
+--------------------
+
+"git-diff-tree", "git-diff-files" and "git-diff" can take '-c' or
+'--cc' option to produce 'combined diff'. For showing a merge commit
+with "git log -p", this is the default format.
+A 'combined diff' format looks like this:
+
+------------
+diff --combined describe.c
+index fabadb8,cc95eb0..4866510
+--- a/describe.c
++++ b/describe.c
+@@@ -98,20 -98,12 +98,20 @@@
+ return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
+ }
+
+- static void describe(char *arg)
+ -static void describe(struct commit *cmit, int last_one)
+++static void describe(char *arg, int last_one)
+ {
+ + unsigned char sha1[20];
+ + struct commit *cmit;
+ struct commit_list *list;
+ static int initialized = 0;
+ struct commit_name *n;
+
+ + if (get_sha1(arg, sha1) < 0)
+ + usage(describe_usage);
+ + cmit = lookup_commit_reference(sha1);
+ + if (!cmit)
+ + usage(describe_usage);
+ +
+ if (!initialized) {
+ initialized = 1;
+ for_each_ref(get_name);
+------------
+
+1. It is preceded with a "git diff" header, that looks like
+ this (when '-c' option is used):
+
+ diff --combined file
++
+or like this (when '--cc' option is used):
+
+ diff --c file
+
+2. It is followed by one or more extended header lines
+ (this example shows a merge with two parents):
+
+ index <hash>,<hash>..<hash>
+ mode <mode>,<mode>..<mode>
+ new file mode <mode>
+ deleted file mode <mode>,<mode>
++
+The `mode <mode>,<mode>..<mode>` line appears only if at least one of
+the <mode> is different from the rest. Extended headers with
+information about detected contents movement (renames and
+copying detection) are designed to work with diff of two
+<tree-ish> and are not used by combined diff format.
+
+3. It is followed by two-line from-file/to-file header
+
+ --- a/file
+ +++ b/file
++
+Similar to two-line header for traditional 'unified' diff
+format, `/dev/null` is used to signal created or deleted
+files.
+
+4. Chunk header format is modified to prevent people from
+ accidentally feeding it to `patch -p1`. Combined diff format
+ was created for review of merge commit changes, and was not
+ meant for apply. The change is similar to the change in the
+ extended 'index' header:
+
+ @@@ <from-file-range> <from-file-range> <to-file-range> @@@
++
+There are (number of parents + 1) `@` characters in the chunk
+header for combined diff format.
+
+Unlike the traditional 'unified' diff format, which shows two
+files A and B with a single column that has `-` (minus --
+appears in A but removed in B), `+` (plus -- missing in A but
+added to B), or `" "` (space -- unchanged) prefix, this format
+compares two or more files file1, file2,... with one file X, and
+shows how X differs from each of fileN. One column for each of
+fileN is prepended to the output line to note how X's line is
+different from it.
+
+A `-` character in the column N means that the line appears in
+fileN but it does not appear in the result. A `+` character
+in the column N means that the line appears in the last file,
+and fileN does not have that line (in other words, the line was
+added, from the point of view of that parent).
+
+In the above example output, the function signature was changed
+from both files (hence two `-` removals from both file1 and
+file2, plus `++` to mean one line that was added does not appear
+in either file1 nor file2). Also two other lines are the same
+from file1 but do not appear in file2 (hence prefixed with ` +`).
+
+When shown by `git diff-tree -c`, it compares the parents of a
+merge commit with the merge result (i.e. file1..fileN are the
+parents). When shown by `git diff-files -c`, it compares the
+two unresolved merge parents with the working tree file
+(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
+"their version").
ifndef::git-format-patch[]
ifndef::git-diff[]
+ifndef::git-log[]
:git-diff-core: 1
+endif::git-log[]
endif::git-diff[]
endif::git-format-patch[]
<em>git-config</em> [<file-option>] --rename-section old_name new_name\r
<em>git-config</em> [<file-option>] --remove-section name\r
<em>git-config</em> [<file-option>] [-z|--null] -l | --list\r
-<em>git-config</em> [<file-option>] --get-color name [default]</div></div>\r
+<em>git-config</em> [<file-option>] --get-color name [default]\r
+<em>git-config</em> [<file-option>] --get-colorbool name [stdout-is-tty]</div></div>\r
</div>\r
<h2>DESCRIPTION</h2>\r
<div class="sectionbody">\r
</p>\r
</dd>\r
<dt>\r
+--get-colorbool name [stdout-is-tty]\r
+</dt>\r
+<dd>\r
+<p>\r
+ Find the color setting for <tt>name</tt> (e.g. <tt>color.diff</tt>) and output\r
+ "true" or "false". <tt>stdout-is-tty</tt> should be either "true" or\r
+ "false", and is taken into account when configuration says\r
+ "auto". If <tt>stdout-is-tty</tt> is missing, then checks the standard\r
+ output of the command itself, and exits with status 0 if color\r
+ is to be used, or exits with status 1 otherwise.\r
+</p>\r
+</dd>\r
+<dt>\r
--get-color name default\r
</dt>\r
<dd>\r
</p>\r
</dd>\r
<dt>\r
+color.interactive\r
+</dt>\r
+<dd>\r
+<p>\r
+ When set to <tt>always</tt>, always use colors in <tt>git add --interactive</tt>.\r
+ When false (or <tt>never</tt>), never. When set to <tt>true</tt> or <tt>auto</tt>, use\r
+ colors only when the output is to the terminal. Defaults to false.\r
+</p>\r
+</dd>\r
+<dt>\r
+color.interactive.<slot>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Use customized color for <tt>git add --interactive</tt>\r
+ output. <tt><slot></tt> may be <tt>prompt</tt>, <tt>header</tt>, or <tt>help</tt>, for\r
+ three distinct types of normal output from interactive\r
+ programs. The values of these variables may be specified as\r
+ in color.branch.<slot>.\r
+</p>\r
+</dd>\r
+<dt>\r
color.pager\r
</dt>\r
<dd>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 06-Dec-2007 03:25:41 UTC\r
+Last updated 07-Dec-2007 09:49:13 UTC\r
</div>\r
</div>\r
</body>\r
'git-config' [<file-option>] --remove-section name
'git-config' [<file-option>] [-z|--null] -l | --list
'git-config' [<file-option>] --get-color name [default]
+'git-config' [<file-option>] --get-colorbool name [stdout-is-tty]
DESCRIPTION
-----------
output without getting confused e.g. by values that
contain line breaks.
+--get-colorbool name [stdout-is-tty]::
+
+ Find the color setting for `name` (e.g. `color.diff`) and output
+ "true" or "false". `stdout-is-tty` should be either "true" or
+ "false", and is taken into account when configuration says
+ "auto". If `stdout-is-tty` is missing, then checks the standard
+ output of the command itself, and exits with status 0 if color
+ is to be used, or exits with status 1 otherwise.
+
--get-color name default::
Find the color configured for `name` (e.g. `color.diff.new`) and
<h2>Generating patches with -p</h2>\r
<div class="sectionbody">\r
<p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run\r
-with a <em>-p</em> option, or "git diff" without the <em>--raw</em> option, they\r
+with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or\r
+"git log" with the "-p" option, they\r
do not produce the output described above; instead they produce a\r
patch file. You can customize the creation of such patches via the\r
GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p>\r
<h2>combined diff format</h2>\r
<div class="sectionbody">\r
<p>"git-diff-tree", "git-diff-files" and "git-diff" can take <em>-c</em> or\r
-<em>--cc</em> option to produce <em>combined diff</em>, which looks like this:</p>\r
+<em>--cc</em> option to produce <em>combined diff</em>. For showing a merge commit\r
+with "git log -p", this is the default format.\r
+A <em>combined diff</em> format looks like this:</p>\r
<div class="listingblock">\r
<div class="content">\r
<pre><tt>diff --combined describe.c\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 16-Nov-2007 10:10:37 UTC\r
+Last updated 07-Dec-2007 09:49:13 UTC\r
</div>\r
</div>\r
</body>\r
<h2>Generating patches with -p</h2>\r
<div class="sectionbody">\r
<p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run\r
-with a <em>-p</em> option, or "git diff" without the <em>--raw</em> option, they\r
+with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or\r
+"git log" with the "-p" option, they\r
do not produce the output described above; instead they produce a\r
patch file. You can customize the creation of such patches via the\r
GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p>\r
<h2>combined diff format</h2>\r
<div class="sectionbody">\r
<p>"git-diff-tree", "git-diff-files" and "git-diff" can take <em>-c</em> or\r
-<em>--cc</em> option to produce <em>combined diff</em>, which looks like this:</p>\r
+<em>--cc</em> option to produce <em>combined diff</em>. For showing a merge commit\r
+with "git log -p", this is the default format.\r
+A <em>combined diff</em> format looks like this:</p>\r
<div class="listingblock">\r
<div class="content">\r
<pre><tt>diff --combined describe.c\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 16-Nov-2007 10:10:37 UTC\r
+Last updated 07-Dec-2007 09:49:14 UTC\r
</div>\r
</div>\r
</body>\r
<h2>Generating patches with -p</h2>\r
<div class="sectionbody">\r
<p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run\r
-with a <em>-p</em> option, or "git diff" without the <em>--raw</em> option, they\r
+with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or\r
+"git log" with the "-p" option, they\r
do not produce the output described above; instead they produce a\r
patch file. You can customize the creation of such patches via the\r
GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p>\r
<h2>combined diff format</h2>\r
<div class="sectionbody">\r
<p>"git-diff-tree", "git-diff-files" and "git-diff" can take <em>-c</em> or\r
-<em>--cc</em> option to produce <em>combined diff</em>, which looks like this:</p>\r
+<em>--cc</em> option to produce <em>combined diff</em>. For showing a merge commit\r
+with "git log -p", this is the default format.\r
+A <em>combined diff</em> format looks like this:</p>\r
<div class="listingblock">\r
<div class="content">\r
<pre><tt>diff --combined describe.c\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 16-Nov-2007 10:10:38 UTC\r
+Last updated 07-Dec-2007 09:49:15 UTC\r
</div>\r
</div>\r
</body>\r
<h2>Generating patches with -p</h2>\r
<div class="sectionbody">\r
<p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run\r
-with a <em>-p</em> option, or "git diff" without the <em>--raw</em> option, they\r
+with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or\r
+"git log" with the "-p" option, they\r
do not produce the output described above; instead they produce a\r
patch file. You can customize the creation of such patches via the\r
GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p>\r
<h2>combined diff format</h2>\r
<div class="sectionbody">\r
<p>"git-diff-tree", "git-diff-files" and "git-diff" can take <em>-c</em> or\r
-<em>--cc</em> option to produce <em>combined diff</em>, which looks like this:</p>\r
+<em>--cc</em> option to produce <em>combined diff</em>. For showing a merge commit\r
+with "git log -p", this is the default format.\r
+A <em>combined diff</em> format looks like this:</p>\r
<div class="listingblock">\r
<div class="content">\r
<pre><tt>diff --combined describe.c\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 16-Nov-2007 10:10:38 UTC\r
+Last updated 07-Dec-2007 09:49:16 UTC\r
</div>\r
</div>\r
</body>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 16-Nov-2007 10:10:39 UTC\r
+Last updated 07-Dec-2007 09:49:18 UTC\r
</div>\r
</div>\r
</body>\r
defaults to UTF-8.\r
</p>\r
</dd>\r
+</dl>\r
+<dl>\r
+<dt>\r
+-p\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate patch (see section on generating patches).\r
+ \r
+</p>\r
+</dd>\r
+<dt>\r
+-u\r
+</dt>\r
+<dd>\r
+<p>\r
+ Synonym for "-p".\r
+</p>\r
+</dd>\r
+<dt>\r
+-U<n>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Shorthand for "--unified=<n>".\r
+</p>\r
+</dd>\r
+<dt>\r
+--unified=<n>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate diffs with <n> lines of context instead of\r
+ the usual three. Implies "-p".\r
+</p>\r
+</dd>\r
+<dt>\r
+--raw\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate the raw format.\r
+ \r
+</p>\r
+</dd>\r
+<dt>\r
+--patch-with-raw\r
+</dt>\r
+<dd>\r
+<p>\r
+ Synonym for "-p --raw".\r
+</p>\r
+</dd>\r
+<dt>\r
+--stat[=width[,name-width]]\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate a diffstat. You can override the default\r
+ output width for 80-column terminal by "--stat=width".\r
+ The width of the filename part can be controlled by\r
+ giving another width to it separated by a comma.\r
+</p>\r
+</dd>\r
+<dt>\r
+--numstat\r
+</dt>\r
+<dd>\r
+<p>\r
+ Similar to --stat, but shows number of added and\r
+ deleted lines in decimal notation and pathname without\r
+ abbreviation, to make it more machine friendly. For\r
+ binary files, outputs two <tt>-</tt> instead of saying\r
+ <tt>0 0</tt>.\r
+</p>\r
+</dd>\r
+<dt>\r
+--shortstat\r
+</dt>\r
+<dd>\r
+<p>\r
+ Output only the last line of the --stat format containing total\r
+ number of modified files, as well as number of added and deleted\r
+ lines.\r
+</p>\r
+</dd>\r
+<dt>\r
+--summary\r
+</dt>\r
+<dd>\r
+<p>\r
+ Output a condensed summary of extended header information\r
+ such as creations, renames and mode changes.\r
+</p>\r
+</dd>\r
+<dt>\r
+--patch-with-stat\r
+</dt>\r
+<dd>\r
+<p>\r
+ Synonym for "-p --stat".\r
+ \r
+</p>\r
+</dd>\r
+<dt>\r
+-z\r
+</dt>\r
+<dd>\r
+<p>\r
+ NUL-line termination on output. This affects the --raw\r
+ output field terminator. Also output from commands such\r
+ as "git-log" will be delimited with NUL between commits.\r
+</p>\r
+</dd>\r
+<dt>\r
+--name-only\r
+</dt>\r
+<dd>\r
+<p>\r
+ Show only names of changed files.\r
+</p>\r
+</dd>\r
+<dt>\r
+--name-status\r
+</dt>\r
+<dd>\r
+<p>\r
+ Show only names and status of changed files.\r
+</p>\r
+</dd>\r
+<dt>\r
+--color\r
+</dt>\r
+<dd>\r
+<p>\r
+ Show colored diff.\r
+</p>\r
+</dd>\r
+<dt>\r
+--no-color\r
+</dt>\r
+<dd>\r
+<p>\r
+ Turn off colored diff, even when the configuration file\r
+ gives the default to color output.\r
+</p>\r
+</dd>\r
+<dt>\r
+--color-words\r
+</dt>\r
+<dd>\r
+<p>\r
+ Show colored word diff, i.e. color words which have changed.\r
+</p>\r
+</dd>\r
+<dt>\r
+--no-renames\r
+</dt>\r
+<dd>\r
+<p>\r
+ Turn off rename detection, even when the configuration\r
+ file gives the default to do so.\r
+</p>\r
+</dd>\r
+<dt>\r
+--check\r
+</dt>\r
+<dd>\r
+<p>\r
+ Warn if changes introduce trailing whitespace\r
+ or an indent that uses a space before a tab.\r
+</p>\r
+</dd>\r
+<dt>\r
+--full-index\r
+</dt>\r
+<dd>\r
+<p>\r
+ Instead of the first handful characters, show full\r
+ object name of pre- and post-image blob on the "index"\r
+ line when generating a patch format output.\r
+</p>\r
+</dd>\r
+<dt>\r
+--binary\r
+</dt>\r
+<dd>\r
+<p>\r
+ In addition to --full-index, output "binary diff" that\r
+ can be applied with "git apply".\r
+</p>\r
+</dd>\r
+<dt>\r
+--abbrev[=<n>]\r
+</dt>\r
+<dd>\r
+<p>\r
+ Instead of showing the full 40-byte hexadecimal object\r
+ name in diff-raw format output and diff-tree header\r
+ lines, show only handful hexdigits prefix. This is\r
+ independent of --full-index option above, which controls\r
+ the diff-patch output format. Non default number of\r
+ digits can be specified with --abbrev=<n>.\r
+</p>\r
+</dd>\r
+<dt>\r
+-B\r
+</dt>\r
+<dd>\r
+<p>\r
+ Break complete rewrite changes into pairs of delete and create.\r
+</p>\r
+</dd>\r
+<dt>\r
+-M\r
+</dt>\r
+<dd>\r
+<p>\r
+ Detect renames.\r
+</p>\r
+</dd>\r
+<dt>\r
+-C\r
+</dt>\r
+<dd>\r
+<p>\r
+ Detect copies as well as renames. See also <tt>--find-copies-harder</tt>.\r
+</p>\r
+</dd>\r
+<dt>\r
+--diff-filter=[ACDMRTUXB*]\r
+</dt>\r
+<dd>\r
+<p>\r
+ Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>),\r
+ Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their\r
+ type (mode) changed (<tt>T</tt>), are Unmerged (<tt>U</tt>), are\r
+ Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>).\r
+ Any combination of the filter characters may be used.\r
+ When <tt>*</tt> (All-or-none) is added to the combination, all\r
+ paths are selected if there is any file that matches\r
+ other criteria in the comparison; if there is no file\r
+ that matches other criteria, nothing is selected.\r
+</p>\r
+</dd>\r
+<dt>\r
+--find-copies-harder\r
+</dt>\r
+<dd>\r
+<p>\r
+ For performance reasons, by default, <tt>-C</tt> option finds copies only\r
+ if the original file of the copy was modified in the same\r
+ changeset. This flag makes the command\r
+ inspect unmodified files as candidates for the source of\r
+ copy. This is a very expensive operation for large\r
+ projects, so use it with caution. Giving more than one\r
+ <tt>-C</tt> option has the same effect.\r
+</p>\r
+</dd>\r
+<dt>\r
+-l<num>\r
+</dt>\r
+<dd>\r
+<p>\r
+ -M and -C options require O(n^2) processing time where n\r
+ is the number of potential rename/copy targets. This\r
+ option prevents rename/copy detection from running if\r
+ the number of rename/copy targets exceeds the specified\r
+ number.\r
+</p>\r
+</dd>\r
+<dt>\r
+-S<string>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Look for differences that contain the change in <string>.\r
+</p>\r
+</dd>\r
+<dt>\r
+--pickaxe-all\r
+</dt>\r
+<dd>\r
+<p>\r
+ When -S finds a change, show all the changes in that\r
+ changeset, not just the files that contain the change\r
+ in <string>.\r
+</p>\r
+</dd>\r
+<dt>\r
+--pickaxe-regex\r
+</dt>\r
+<dd>\r
+<p>\r
+ Make the <string> not a plain string but an extended POSIX\r
+ regex to match.\r
+</p>\r
+</dd>\r
+<dt>\r
+-O<orderfile>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Output the patch in the order specified in the\r
+ <orderfile>, which has one shell glob pattern per line.\r
+</p>\r
+</dd>\r
+<dt>\r
+-R\r
+</dt>\r
+<dd>\r
+<p>\r
+ Swap two inputs; that is, show differences from index or\r
+ on-disk file to tree contents.\r
+</p>\r
+</dd>\r
+<dt>\r
+--text\r
+</dt>\r
+<dd>\r
+<p>\r
+ Treat all files as text.\r
+</p>\r
+</dd>\r
+<dt>\r
+-a\r
+</dt>\r
+<dd>\r
+<p>\r
+ Shorthand for "--text".\r
+</p>\r
+</dd>\r
+<dt>\r
+--ignore-space-at-eol\r
+</dt>\r
+<dd>\r
+<p>\r
+ Ignore changes in white spaces at EOL.\r
+</p>\r
+</dd>\r
+<dt>\r
+--ignore-space-change\r
+</dt>\r
+<dd>\r
+<p>\r
+ Ignore changes in amount of white space. This ignores white\r
+ space at line end, and consider all other sequences of one or\r
+ more white space characters to be equivalent.\r
+</p>\r
+</dd>\r
+<dt>\r
+-b\r
+</dt>\r
+<dd>\r
+<p>\r
+ Shorthand for "--ignore-space-change".\r
+</p>\r
+</dd>\r
+<dt>\r
+--ignore-all-space\r
+</dt>\r
+<dd>\r
+<p>\r
+ Ignore white space when comparing lines. This ignores\r
+ difference even if one line has white space where the other\r
+ line has none.\r
+</p>\r
+</dd>\r
+<dt>\r
+-w\r
+</dt>\r
+<dd>\r
+<p>\r
+ Shorthand for "--ignore-all-space".\r
+</p>\r
+</dd>\r
+<dt>\r
+--exit-code\r
+</dt>\r
+<dd>\r
+<p>\r
+ Make the program exit with codes similar to diff(1).\r
+ That is, it exits with 1 if there were differences and\r
+ 0 means no differences.\r
+</p>\r
+</dd>\r
+<dt>\r
+--quiet\r
+</dt>\r
+<dd>\r
+<p>\r
+ Disable all output of the program. Implies --exit-code.\r
+</p>\r
+</dd>\r
+<dt>\r
+--ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Allow an external diff helper to be executed. If you set an\r
+ external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need\r
+ to use this option with <a href="git-log.html">git-log(1)</a> and friends.\r
+</p>\r
+</dd>\r
+<dt>\r
+--no-ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Disallow external diff drivers.\r
+</p>\r
+</dd>\r
+</dl>\r
+<p>For more detailed explanation on these common options, see also\r
+<a href="diffcore.html">diffcore documentation</a>.</p>\r
+<dl>\r
<dt>\r
-<n>\r
</dt>\r
</p>\r
</dd>\r
<dt>\r
--p\r
-</dt>\r
-<dd>\r
-<p>\r
- Show the change the commit introduces in a patch form.\r
-</p>\r
-</dd>\r
-<dt>\r
-g, --walk-reflogs\r
</dt>\r
<dd>\r
</li>\r
</ul>\r
</div>\r
+<h2>Generating patches with -p</h2>\r
+<div class="sectionbody">\r
+<p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run\r
+with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or\r
+"git log" with the "-p" option, they\r
+do not produce the output described above; instead they produce a\r
+patch file. You can customize the creation of such patches via the\r
+GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p>\r
+<p>What the -p option produces is slightly different from the traditional\r
+diff format.</p>\r
+<ol>\r
+<li>\r
+<p>\r
+It is preceded with a "git diff" header, that looks like\r
+ this:\r
+</p>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><tt>diff --git a/file1 b/file2</tt></pre>\r
+</div></div>\r
+<p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is\r
+involved. Especially, even for a creation or a deletion,\r
+<tt>/dev/null</tt> is _not_ used in place of <tt>a/</tt> or <tt>b/</tt> filenames.</p>\r
+<p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the\r
+name of the source file of the rename/copy and the name of\r
+the file that rename/copy produces, respectively.</p>\r
+</li>\r
+<li>\r
+<p>\r
+It is followed by one or more extended header lines:\r
+</p>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><tt>old mode <mode>\r
+new mode <mode>\r
+deleted file mode <mode>\r
+new file mode <mode>\r
+copy from <path>\r
+copy to <path>\r
+rename from <path>\r
+rename to <path>\r
+similarity index <number>\r
+dissimilarity index <number>\r
+index <hash>..<hash> <mode></tt></pre>\r
+</div></div>\r
+</li>\r
+<li>\r
+<p>\r
+TAB, LF, double quote and backslash characters in pathnames\r
+ are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively.\r
+ If there is need for such substitution then the whole\r
+ pathname is put in double quotes.\r
+</p>\r
+</li>\r
+</ol>\r
+<p>The similarity index is the percentage of unchanged lines, and\r
+the dissimilarity index is the percentage of changed lines. It\r
+is a rounded down integer, followed by a percent sign. The\r
+similarity index value of 100% is thus reserved for two equal\r
+files, while 100% dissimilarity means that no line from the old\r
+file made it into the new one.</p>\r
+</div>\r
+<h2>combined diff format</h2>\r
+<div class="sectionbody">\r
+<p>"git-diff-tree", "git-diff-files" and "git-diff" can take <em>-c</em> or\r
+<em>--cc</em> option to produce <em>combined diff</em>. For showing a merge commit\r
+with "git log -p", this is the default format.\r
+A <em>combined diff</em> format looks like this:</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>diff --combined describe.c\r
+index fabadb8,cc95eb0..4866510\r
+--- a/describe.c\r
++++ b/describe.c\r
+@@@ -98,20 -98,12 +98,20 @@@\r
+ return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;\r
+ }\r
+\r
+- static void describe(char *arg)\r
+ -static void describe(struct commit *cmit, int last_one)\r
+++static void describe(char *arg, int last_one)\r
+ {\r
+ + unsigned char sha1[20];\r
+ + struct commit *cmit;\r
+ struct commit_list *list;\r
+ static int initialized = 0;\r
+ struct commit_name *n;\r
+\r
+ + if (get_sha1(arg, sha1) < 0)\r
+ + usage(describe_usage);\r
+ + cmit = lookup_commit_reference(sha1);\r
+ + if (!cmit)\r
+ + usage(describe_usage);\r
+ +\r
+ if (!initialized) {\r
+ initialized = 1;\r
+ for_each_ref(get_name);</tt></pre>\r
+</div></div>\r
+<ol>\r
+<li>\r
+<p>\r
+It is preceded with a "git diff" header, that looks like\r
+ this (when <em>-c</em> option is used):\r
+</p>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><tt>diff --combined file</tt></pre>\r
+</div></div>\r
+<p>or like this (when <em>--cc</em> option is used):</p>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><tt>diff --c file</tt></pre>\r
+</div></div>\r
+</li>\r
+<li>\r
+<p>\r
+It is followed by one or more extended header lines\r
+ (this example shows a merge with two parents):\r
+</p>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><tt>index <hash>,<hash>..<hash>\r
+mode <mode>,<mode>..<mode>\r
+new file mode <mode>\r
+deleted file mode <mode>,<mode></tt></pre>\r
+</div></div>\r
+<p>The <tt>mode <mode>,<mode>..<mode></tt> line appears only if at least one of\r
+the <mode> is different from the rest. Extended headers with\r
+information about detected contents movement (renames and\r
+copying detection) are designed to work with diff of two\r
+<tree-ish> and are not used by combined diff format.</p>\r
+</li>\r
+<li>\r
+<p>\r
+It is followed by two-line from-file/to-file header\r
+</p>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><tt>--- a/file\r
++++ b/file</tt></pre>\r
+</div></div>\r
+<p>Similar to two-line header for traditional <em>unified</em> diff\r
+format, <tt>/dev/null</tt> is used to signal created or deleted\r
+files.</p>\r
+</li>\r
+<li>\r
+<p>\r
+Chunk header format is modified to prevent people from\r
+ accidentally feeding it to <tt>patch -p1</tt>. Combined diff format\r
+ was created for review of merge commit changes, and was not\r
+ meant for apply. The change is similar to the change in the\r
+ extended <em>index</em> header:\r
+</p>\r
+<div class="literalblock">\r
+<div class="content">\r
+<pre><tt>@@@ <from-file-range> <from-file-range> <to-file-range> @@@</tt></pre>\r
+</div></div>\r
+<p>There are (number of parents + 1) <tt>@</tt> characters in the chunk\r
+header for combined diff format.</p>\r
+</li>\r
+</ol>\r
+<p>Unlike the traditional <em>unified</em> diff format, which shows two\r
+files A and B with a single column that has <tt>-</tt> (minus —\r
+appears in A but removed in B), <tt>+</tt> (plus — missing in A but\r
+added to B), or <tt>" "</tt> (space — unchanged) prefix, this format\r
+compares two or more files file1, file2,… with one file X, and\r
+shows how X differs from each of fileN. One column for each of\r
+fileN is prepended to the output line to note how X's line is\r
+different from it.</p>\r
+<p>A <tt>-</tt> character in the column N means that the line appears in\r
+fileN but it does not appear in the result. A <tt>+</tt> character\r
+in the column N means that the line appears in the last file,\r
+and fileN does not have that line (in other words, the line was\r
+added, from the point of view of that parent).</p>\r
+<p>In the above example output, the function signature was changed\r
+from both files (hence two <tt>-</tt> removals from both file1 and\r
+file2, plus <tt>++</tt> to mean one line that was added does not appear\r
+in either file1 nor file2). Also two other lines are the same\r
+from file1 but do not appear in file2 (hence prefixed with <tt> +</tt>).</p>\r
+<p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a\r
+merge commit with the merge result (i.e. file1..fileN are the\r
+parents). When shown by <tt>git diff-files -c</tt>, it compares the\r
+two unresolved merge parents with the working tree file\r
+(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka\r
+"their version").</p>\r
+</div>\r
<h2>Examples</h2>\r
<div class="sectionbody">\r
<dl>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 14-Nov-2007 12:11:35 UTC\r
+Last updated 07-Dec-2007 09:49:18 UTC\r
</div>\r
</div>\r
</body>\r
include::pretty-options.txt[]
+:git-log: 1
+include::diff-options.txt[]
+
-<n>::
Limits the number of commits to show.
commit. This option gives a better overview of the
evolution of a particular branch.
--p::
- Show the change the commit introduces in a patch form.
-
-g, \--walk-reflogs::
Show commits as they were recorded in the reflog. The log contains
a record about how the tip of a reference was changed.
include::pretty-formats.txt[]
+include::diff-generate-patch.txt[]
Examples
--------
<div class="sectionbody">\r
<p>The output from this command is designed to be used as a commit\r
template comments, and all the output lines are prefixed with <em>#</em>.</p>\r
+<p>The paths mentioned in the output, unlike many other git commands, are\r
+made relative to the current directory, if you are working in a\r
+subdirectory (this is on purpose, to help cutting and pasting).</p>\r
</div>\r
<h2>CONFIGURATION</h2>\r
<div class="sectionbody">\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 14-Nov-2007 12:11:51 UTC\r
+Last updated 07-Dec-2007 09:49:19 UTC\r
</div>\r
</div>\r
</body>\r
The output from this command is designed to be used as a commit
template comments, and all the output lines are prefixed with '#'.
+The paths mentioned in the output, unlike many other git commands, are
+made relative to the current directory, if you are working in a
+subdirectory (this is on purpose, to help cutting and pasting).
+
CONFIGURATION
-------------