From a6080a0a44d5ead84db3dabbbc80e82df838533d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 7 Jun 2007 00:04:01 -0700 Subject: War on whitespace This uses "git-apply --whitespace=strip" to fix whitespace errors that have crept in to our source files over time. There are a few files that need to have trailing whitespaces (most notably, test vectors). The results still passes the test, and build result in Documentation/ area is unchanged. Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 1689c74817..b2a05937f9 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -100,8 +100,8 @@ that matches other criteria, nothing is selected. --find-copies-harder:: - For performance reasons, by default, -C option finds copies only - if the original file of the copy was modified in the same + For performance reasons, by default, -C option finds copies only + if the original file of the copy was modified in the same changeset. This flag makes the command inspect unmodified files as candidates for the source of copy. This is a very expensive operation for large -- cgit v1.2.3 From ca6c097089a38d447de0190ea61e9746a40a170c Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 11 Jun 2007 21:12:19 +0100 Subject: Teach diff to imply --find-copies-harder upon -C -C Earlier, a second "-C" on the command line had no effect. But "--find-copies-harder" is so long to type, let's make doubled -C enable that option. It is in line with how "git blame" handles such doubled options to mean "work harder". Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index b2a05937f9..0f07c9c4a8 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -86,7 +86,7 @@ Detect renames. -C:: - Detect copies as well as renames. + Detect copies as well as renames. See also `--find-copies-harder`. --diff-filter=[ACDMRTUXB*]:: Select only files that are Added (`A`), Copied (`C`), @@ -100,12 +100,13 @@ that matches other criteria, nothing is selected. --find-copies-harder:: - For performance reasons, by default, -C option finds copies only + For performance reasons, by default, `-C` option finds copies only if the original file of the copy was modified in the same changeset. This flag makes the command inspect unmodified files as candidates for the source of copy. This is a very expensive operation for large - projects, so use it with caution. + projects, so use it with caution. Giving more than one + `-C` option has the same effect. -l:: -M and -C options require O(n^2) processing time where n -- cgit v1.2.3 From 72909befaa043fcc975115bb56d25a6e7dc65fb6 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 30 Jun 2007 18:47:07 +0100 Subject: Add diff-option --ext-diff To prevent funky games with external diff engines, git-log and friends prevent external diff engines from being called. That makes sense in the context of git-format-patch or git-rebase. However, for "git log -p" it is not so nice to get the message that binary files cannot be compared, while "git diff" has no problems with them, if you provided an external diff driver. With this patch, "git log --ext-diff -p" will do what you expect, and the option "--no-ext-diff" can be used to override that setting. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 0f07c9c4a8..3d2b9d0a06 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -168,5 +168,13 @@ --quiet:: Disable all output of the program. Implies --exit-code. +--ext-diff:: + Allow an external diff helper to be executed. If you set an + external diff driver with gitlink:gitattributes(5), you need + to use this option with gitlink:git-log(1) and friends. + +--no-ext-diff:: + Disallow external diff drivers. + For more detailed explanation on these common options, see also link:diffcore.html[diffcore documentation]. -- cgit v1.2.3 From 4eb994733d75d40cab87e7b4736166cf33e7787a Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Wed, 25 Jul 2007 12:08:17 +0200 Subject: Document --unified/-U option Signed-off-by: Robin Rosenberg Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 3d2b9d0a06..82165763ba 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -4,6 +4,13 @@ -u:: Synonym for "-p". +-U:: + Shorthand for "--unified=". + +--unified=:: + Generate diffs with lines of context instead of + the usual three. Implies "-p". + --raw:: Generate the raw format. -- cgit v1.2.3 From 654a7ccc56f5dee3d11fbf6e928c14402c7495de Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 25 Jul 2007 23:45:42 -0700 Subject: Update description of -z option. The NUL you see in "git log" (without diff) output are between records, not at the end of each record. Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 82165763ba..228ccaf10a 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -43,7 +43,9 @@ Synonym for "-p --stat". -z:: - \0 line termination on output + NUL-line termination on output. This affects the --raw + output field terminator. Also output from commands such + as "git-log" will be delimited with NUL between commits. --name-only:: Show only names of changed files. -- cgit v1.2.3 From 63a1f810a6f976a307aaaabdce21082f6d7f20aa Mon Sep 17 00:00:00 2001 From: Steffen Prohaska Date: Tue, 2 Oct 2007 08:14:37 +0200 Subject: fixed link in documentation of diff-options Signed-off-by: Steffen Prohaska Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 228ccaf10a..b1f528ae88 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -179,8 +179,8 @@ --ext-diff:: Allow an external diff helper to be executed. If you set an - external diff driver with gitlink:gitattributes(5), you need - to use this option with gitlink:git-log(1) and friends. + external diff driver with gitlink:gitattributes[5], you need + to use this option with gitlink:git-log[1] and friends. --no-ext-diff:: Disallow external diff drivers. -- cgit v1.2.3 From c1a95fa629b837fd291ca0e1428604710a2bc1dd Mon Sep 17 00:00:00 2001 From: Sergei Organov Date: Thu, 15 Nov 2007 16:19:29 +0300 Subject: Documentation: customize diff-options depending on particular command Customize diff-options depending on particular command as follows, mostly to make git-diff and git-format-patch manuals less confusing: * git-format-patch: - Mark --patch-with-stat as being the default. - Change -p description so that it matches what it actually does and so that it doesn't refer to absent "section on generating patches". * git-diff: mark -p as being the default. * git-diff-index/git-diff-files/git-diff-tree: mark --raw as being the default. Signed-off-by: Sergei Organov Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index b1f528ae88..e4af393515 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -1,5 +1,25 @@ +// Please don't remove this comment as asciidoc behaves badly when +// the first non-empty line is ifdef/ifndef. The symptom is that +// without this comment the attribute conditionally +// defined below ends up being defined unconditionally. +// Last checked with asciidoc 7.0.2. + +ifndef::git-format-patch[] +ifndef::git-diff[] +:git-diff-core: 1 +endif::git-diff[] +endif::git-format-patch[] + +ifdef::git-format-patch[] -p:: - Generate patch (see section on generating patches) + Generate patches without diffstat. +endif::git-format-patch[] + +ifndef::git-format-patch[] +-p:: + Generate patch (see section on generating patches). + {git-diff? This is the default.} +endif::git-format-patch[] -u:: Synonym for "-p". @@ -13,6 +33,7 @@ --raw:: Generate the raw format. + {git-diff-core? This is the default.} --patch-with-raw:: Synonym for "-p --raw". @@ -41,6 +62,7 @@ --patch-with-stat:: Synonym for "-p --stat". + {git-format-patch? This is the default.} -z:: NUL-line termination on output. This affects the --raw -- cgit v1.2.3 From 272bd3cfd059cf867b979d5c11b0ccce9bcccbb3 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 1 Nov 2007 15:57:40 +0100 Subject: Include diff options in the git-log manpage [jc: with quite a few fixups] Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index e4af393515..d0154bbc0a 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -6,7 +6,9 @@ ifndef::git-format-patch[] ifndef::git-diff[] +ifndef::git-log[] :git-diff-core: 1 +endif::git-log[] endif::git-diff[] endif::git-format-patch[] -- cgit v1.2.3 From 0ac7903ee3c7c93d2426a4aa4f3732bee73e0365 Mon Sep 17 00:00:00 2001 From: Wincent Colaiuta Date: Wed, 12 Dec 2007 09:12:01 +0100 Subject: Use "whitespace" consistently For consistency, change "white space" and "whitespaces" to "whitespace", fixing a couple of adjacent grammar problems in the docs. Signed-off-by: Wincent Colaiuta Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index d0154bbc0a..5d22b7b58c 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -175,19 +175,19 @@ endif::git-format-patch[] Shorthand for "--text". --ignore-space-at-eol:: - Ignore changes in white spaces at EOL. + Ignore changes in whitespace at EOL. --ignore-space-change:: - Ignore changes in amount of white space. This ignores white - space at line end, and consider all other sequences of one or - more white space characters to be equivalent. + Ignore changes in amount of whitespace. This ignores whitespace + at line end, and considers all other sequences of one or + more whitespace characters to be equivalent. -b:: Shorthand for "--ignore-space-change". --ignore-all-space:: - Ignore white space when comparing lines. This ignores - difference even if one line has white space where the other + Ignore whitespace when comparing lines. This ignores + differences even if one line has whitespace where the other line has none. -w:: -- cgit v1.2.3 From 62c64895cfcf3bbf34969a69fa96a631f7d5b14e Mon Sep 17 00:00:00 2001 From: Wincent Colaiuta Date: Thu, 13 Dec 2007 21:24:52 +0100 Subject: "diff --check" should affect exit status "git diff" has a --check option that can be used to check for whitespace problems but it only reported by printing warnings to the console. Now when the --check option is used we give a non-zero exit status, making "git diff --check" nicer to use in scripts and hooks. Signed-off-by: Wincent Colaiuta Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 5d22b7b58c..9ecc1d7bc4 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -93,7 +93,9 @@ endif::git-format-patch[] --check:: Warn if changes introduce trailing whitespace - or an indent that uses a space before a tab. + or an indent that uses a space before a tab. Exits with + non-zero status if problems are found. Not compatible with + --exit-code. --full-index:: Instead of the first handful characters, show full -- cgit v1.2.3 From eab9a40b6dd5c1c571b1deb264133db47bb4794d Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 18 Dec 2007 19:32:14 +0000 Subject: Teach diff machinery to display other prefixes than "a/" and "b/" With the new options "--src-prefix=", "--dst-prefix=" and "--no-prefix", you can now control the path prefixes of the diff machinery. These used to by hardwired to "a/" for the source prefix and "b/" for the destination prefix. Initial patch by Pascal Obry. Sane option names suggested by Linus. Signed-off-by: Johannes Schindelin Acked-by: Linus Torvalds Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 9ecc1d7bc4..1a78635fba 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -211,5 +211,14 @@ endif::git-format-patch[] --no-ext-diff:: Disallow external diff drivers. +--src-prefix=:: + Show the given source prefix instead of "a/". + +--dst-prefix=:: + Show the given destination prefix instead of "b/". + +--no-prefix:: + Do not show any source or destination prefix. + For more detailed explanation on these common options, see also link:diffcore.html[diffcore documentation]. -- cgit v1.2.3 From 5162e69732d13dd079919a389a6ace8878aad716 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 29 Dec 2007 00:20:38 -0600 Subject: Documentation: rename gitlink macro to linkgit Between AsciiDoc 8.2.2 and 8.2.3, the following change was made to the stock Asciidoc configuration: @@ -149,7 +153,10 @@ # Inline macros. # Backslash prefix required for escape processing. # (?s) re flag for line spanning. -(?su)[\\]?(?P\w(\w|-)*?):(?P\S*?)(\[(?P.*?)\])= + +# Explicit so they can be nested. +(?su)[\\]?(?P(http|https|ftp|file|mailto|callto|image|link)):(?P\S*?)(\[(?P.*?)\])= + # Anchor: [[[id]]]. Bibliographic anchor. (?su)[\\]?\[\[\[(?P[\w][\w-]*?)\]\]\]=anchor3 # Anchor: [[id,xreflabel]] This default regex now matches explicit values, and unfortunately in this case gitlink was being matched by just 'link', causing the wrong inline macro template to be applied. By renaming the macro, we can avoid being matched by the wrong regex. Signed-off-by: Dan McGee Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 1a78635fba..8d35cbd60d 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -205,8 +205,8 @@ endif::git-format-patch[] --ext-diff:: Allow an external diff helper to be executed. If you set an - external diff driver with gitlink:gitattributes[5], you need - to use this option with gitlink:git-log[1] and friends. + external diff driver with linkgit:gitattributes[5], you need + to use this option with linkgit:git-log[1] and friends. --no-ext-diff:: Disallow external diff drivers. -- cgit v1.2.3 From cd676a513672eeb9663c6d4de276a1c860a4b879 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 12 Feb 2008 14:26:02 -0800 Subject: diff --relative: output paths as relative to the current subdirectory This adds --relative option to the diff family. When you start from a subdirectory: $ git diff --relative shows only the diff that is inside your current subdirectory, and without $prefix part. People who usually live in subdirectories may like it. There are a few things I should also mention about the change: - This works not just with diff but also works with the log family of commands, but the history pruning is not affected. In other words, if you go to a subdirectory, you can say: $ git log --relative -p but it will show the log message even for commits that do not touch the current directory. You can limit it by giving pathspec yourself: $ git log --relative -p . This originally was not a conscious design choice, but we have a way to affect diff pathspec and pruning pathspec independently. IOW "git log --full-diff -p ." tells it to prune history to commits that affect the current subdirectory but show the changes with full context. I think it makes more sense to leave pruning independent from --relative than the obvious alternative of always pruning with the current subdirectory, which would break the symmetry. - Because this works also with the log family, you could format-patch a single change, limiting the effect to your subdirectory, like so: $ cd gitk-git $ git format-patch -1 --relative 911f1eb But because that is a special purpose usage, this option will never become the default, with or without repository or user preference configuration. The risk of producing a partial patch and sending it out by mistake is too great if we did so. - This is inherently incompatible with --no-index, which is a bolted-on hack that does not have much to do with git itself. I didn't bother checking and erroring out on the combined use of the options, but probably I should. Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 8d35cbd60d..286c30c01a 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -170,6 +170,11 @@ endif::git-format-patch[] Swap two inputs; that is, show differences from index or on-disk file to tree contents. +--relative:: + When run from a subdirectory of the project, it can be + told to exclude changes outside the directory and show + pathnames relative to it with this option. + --text:: Treat all files as text. -- cgit v1.2.3 From c0cb4a067972700f0682fbab13768bcc7dc7a3c3 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 13 Feb 2008 00:34:39 -0800 Subject: diff --relative: help working in a bare repository This allows the --relative option to say which subdirectory to pretend to be in, so that in a bare repository, you can say: $ git log --relative=drivers/ v2.6.20..v2.6.22 -- drivers/scsi/ Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 286c30c01a..8dc5b001c4 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -170,10 +170,13 @@ endif::git-format-patch[] Swap two inputs; that is, show differences from index or on-disk file to tree contents. ---relative:: +--relative[=]:: When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show - pathnames relative to it with this option. + pathnames relative to it with this option. When you are + not in a subdirectory (e.g. in a bare repository), you + can name which subdirectory to make the output relative + to by giving a as an argument. --text:: Treat all files as text. -- cgit v1.2.3 From 37152d831048a0b30600a7b7e7926af2d5bcfab8 Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Mon, 21 Apr 2008 18:15:52 +0000 Subject: diff-options.txt: document the new "--dirstat" option This commit adds the documentation for the new option added by 7df7c01 (Add "--dirstat" for some directory statistics, 2008-02-12). Noticed by Clint Adams, reported through http://bugs.debian.org/476437 Signed-off-by: Gerrit Pape Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 8dc5b001c4..01e7a57851 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -58,6 +58,14 @@ endif::git-format-patch[] number of modified files, as well as number of added and deleted lines. +--dirstat[=limit]:: + Output only the sub-directories that are impacted by a diff, + and to what degree they are impacted. You can override the + default cut-off in percent (3) by "--dirstat=limit". If you + want to enable "cumulative" directory statistics, you can use + the "--cumulative" flag, which adds up percentages recursively + even when they have been already reported for a sub-directory. + --summary:: Output a condensed summary of extended header information such as creations, renames and mode changes. -- cgit v1.2.3 From a6f47b2be43fbe70236316edc6c87ad9522c485d Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 22 Apr 2008 14:23:48 +0200 Subject: diff options documentation: refer to --diff-filter in --name-status git diff --name-status outputs letters, but the meaning of those letters is documented elsewhere. Add a note to make the manpage more intuitive. Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 8d35cbd60d..60d0e53a78 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -75,7 +75,8 @@ endif::git-format-patch[] Show only names of changed files. --name-status:: - Show only names and status of changed files. + Show only names and status of changed files. See the description + of the `--diff-filter` option on what the status letters mean. --color:: Show colored diff. -- cgit v1.2.3 From 50fd9bd8430a957ea6c6674ce6112f375985abbc Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 14 May 2008 18:03:31 +0100 Subject: diff options: Introduce --ignore-submodules The new option --ignore-submodules can now be used to ignore changes in submodules. Why? Sometimes it is not interesting when a submodule changed. For example, when reordering some commits in the superproject, a dirty submodule is usually totally uninteresting. So we will use this option in git-rebase to test for a dirty working tree. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 13234fa280..859d67990a 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -228,6 +228,9 @@ endif::git-format-patch[] --no-ext-diff:: Disallow external diff drivers. +--ignore-submodules:: + Ignore changes to submodules in the diff generation. + --src-prefix=:: Show the given source prefix instead of "a/". -- cgit v1.2.3 From 30eba7bf2caa327b4251d66bf7157dda97512e96 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Fri, 6 Jun 2008 09:07:28 +0200 Subject: documentation: convert "diffcore" and "repository-layout" to man pages This patch renames the following documents and at the same time converts them to the man format: diffcore.txt -> gitdiffcore.txt (man section 7) repository-layout.txt -> gitrepository-layout.txt (man section 5) Other documents that reference the above ones are changed accordingly. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 859d67990a..572154834b 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -241,4 +241,4 @@ endif::git-format-patch[] Do not show any source or destination prefix. For more detailed explanation on these common options, see also -link:diffcore.html[diffcore documentation]. +linkgit:gitdiffcore[7][diffcore documentation]. -- cgit v1.2.3 From 6998e4db52c6d98670a2cd1e59a7708dc18e2c52 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 30 Jun 2008 17:01:21 -0500 Subject: Documentation: fix links to tutorials and other new manual pages With the conversion of HTML documentation to man pages tutorial.html -> gittutorial (7) tutorial-2.html -> gittutorial-2 (7) cvs-migration.html -> gitcvs-migration (7) diffcore.html -> gitdiffcore (7) repository-layout.html -> gitrepository-layout (5) hooks.html -> githooks (5) glossary.html -> gitglossary (7) core-tutorial.html -> gitcore-tutorial (7) and the automatic update of references to these pages, a little debris was left behind. We clear it away. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 572154834b..cba90fd27c 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -241,4 +241,4 @@ endif::git-format-patch[] Do not show any source or destination prefix. For more detailed explanation on these common options, see also -linkgit:gitdiffcore[7][diffcore documentation]. +linkgit:gitdiffcore[7]. -- cgit v1.2.3 From 6457e58c8fc00ef1c72724dad5f8baf54cfee5a2 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 2 Jul 2008 09:49:59 +0200 Subject: reword --full-index description Signed-off-by: Jim Meyering Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index cba90fd27c..1759386404 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -107,9 +107,9 @@ endif::git-format-patch[] --exit-code. --full-index:: - Instead of the first handful characters, show full - object name of pre- and post-image blob on the "index" - line when generating a patch format output. + Instead of the first handful of characters, show the full + pre- and post-image blob object names on the "index" + line when generating patch format output. --binary:: In addition to --full-index, output "binary diff" that -- cgit v1.2.3 From 62e00b0a9a72337a1ae2818ff3640e07c78db636 Mon Sep 17 00:00:00 2001 From: Heikki Orsila Date: Mon, 1 Sep 2008 03:50:28 +0300 Subject: Improve documentation for --dirstat diff option Signed-off-by: Heikki Orsila Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index cba90fd27c..746646bb3d 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -59,12 +59,11 @@ endif::git-format-patch[] lines. --dirstat[=limit]:: - Output only the sub-directories that are impacted by a diff, - and to what degree they are impacted. You can override the - default cut-off in percent (3) by "--dirstat=limit". If you - want to enable "cumulative" directory statistics, you can use - the "--cumulative" flag, which adds up percentages recursively - even when they have been already reported for a sub-directory. + Output the distribution of relative amount of changes (number of lines added or + removed) for each sub-directory. Directories with changes below + a cut-off percent (3% by default) are not shown. The cut-off percent + can be set with "--dirstat=limit". Changes in a child directory is not + counted for the parent directory, unless "--cumulative" is used. --summary:: Output a condensed summary of extended header information -- cgit v1.2.3 From fd33777b7871eefa440f89ccf7c432895af09c74 Mon Sep 17 00:00:00 2001 From: Heikki Orsila Date: Fri, 5 Sep 2008 22:27:35 +0300 Subject: diff --dirstat-by-file: count changed files, not lines This new option --dirstat-by-file is the same as --dirstat, but it counts "impacted files" instead of "impacted lines" (lines that are added or removed). Signed-off-by: Heikki Orsila Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 6e268326da..7788d4fa4a 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -65,6 +65,9 @@ endif::git-format-patch[] can be set with "--dirstat=limit". Changes in a child directory is not counted for the parent directory, unless "--cumulative" is used. +--dirstat-by-file[=limit]:: + Same as --dirstat, but counts changed files instead of lines. + --summary:: Output a condensed summary of extended header information such as creations, renames and mode changes. -- cgit v1.2.3 From f07c3c53f8e7f243730de74918abcc72bd85c2ef Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 18 Oct 2008 08:20:51 -0700 Subject: diff(1): clarify what "T"ypechange status means Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 746646bb3d..45885bbbb2 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -134,7 +134,8 @@ endif::git-format-patch[] --diff-filter=[ACDMRTUXB*]:: Select only files that are Added (`A`), Copied (`C`), Deleted (`D`), Modified (`M`), Renamed (`R`), have their - type (mode) changed (`T`), are Unmerged (`U`), are + type (i.e. regular file, symlink, submodule, ...) changed (`T`), + are Unmerged (`U`), are Unknown (`X`), or have had their pairing Broken (`B`). Any combination of the filter characters may be used. When `*` (All-or-none) is added to the combination, all -- cgit v1.2.3 From 6d0e674a575421347abe5749e645ca6dc78c8207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 28 Dec 2008 19:45:32 +0100 Subject: diff: add option to show context between close hunks Merge two hunks if there is only the specified number of otherwise unshown context between them. For --inter-hunk-context=1, the resulting patch has the same number of lines but shows uninterrupted context instead of a context header line in between. Patches generated with this option are easier to read but are also more likely to conflict if the file to be patched contains other changes. This patch keeps the default for this option at 0. It is intended to just make the feature available in order to see its advantages and downsides. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index c62b45cdba..c7fcc8007a 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -215,6 +215,10 @@ endif::git-format-patch[] -w:: Shorthand for "--ignore-all-space". +--inter-hunk-context=:: + Show the context between diff hunks, up to the specified number + of lines, thereby fusing hunks that are close to each other. + --exit-code:: Make the program exit with codes similar to diff(1). That is, it exits with 1 if there were differences and -- cgit v1.2.3 From a9e67c8ccc6958d09c575a3d4837a49d8a2ec7d5 Mon Sep 17 00:00:00 2001 From: "jidanni@jidanni.org" Date: Mon, 29 Dec 2008 15:03:17 +0800 Subject: Documentation/diff-options.txt: unify options Instead of listing short option (e.g. "-U") as a shorthand for its longer counterpart (e.g. "--unified="), list the synonyms together. It saves one indirection to find what the reader wants. Signed-off-by: jidanni Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index c62b45cdba..b432d2518a 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -19,16 +19,12 @@ endif::git-format-patch[] ifndef::git-format-patch[] -p:: +-u:: Generate patch (see section on generating patches). {git-diff? This is the default.} endif::git-format-patch[] --u:: - Synonym for "-p". - -U:: - Shorthand for "--unified=". - --unified=:: Generate diffs with lines of context instead of the usual three. Implies "-p". @@ -190,31 +186,25 @@ endif::git-format-patch[] can name which subdirectory to make the output relative to by giving a as an argument. +-a:: --text:: Treat all files as text. --a:: - Shorthand for "--text". - --ignore-space-at-eol:: Ignore changes in whitespace at EOL. +-b:: --ignore-space-change:: Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent. --b:: - Shorthand for "--ignore-space-change". - +-w:: --ignore-all-space:: Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none. --w:: - Shorthand for "--ignore-all-space". - --exit-code:: Make the program exit with codes similar to diff(1). That is, it exits with 1 if there were differences and -- cgit v1.2.3 From 34292bddb861f3cb52a524fdce67234430a744fe Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 1 Jan 2009 17:39:17 +0100 Subject: Introduce the diff option '--patience' This commit teaches Git to produce diff output using the patience diff algorithm with the diff option '--patience'. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index c62b45cdba..808bf87277 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -40,6 +40,9 @@ endif::git-format-patch[] --patch-with-raw:: Synonym for "-p --raw". +--patience: + Generate a diff using the "patience diff" algorithm. + --stat[=width[,name-width]]:: Generate a diffstat. You can override the default output width for 80-column terminal by "--stat=width". -- cgit v1.2.3 From 323b9db839cc4e49008666e402aac3264e359423 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Mon, 12 Jan 2009 14:02:07 -0600 Subject: Fix Documentation typos surrounding the word 'handful'. Some instances replaced by "handful of", others use the word "few", a couple get a slight rewording. Signed-off-by: Jon Loeliger Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 671f533ca3..43793d7500 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -116,7 +116,7 @@ endif::git-format-patch[] --abbrev[=]:: Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header - lines, show only handful hexdigits prefix. This is + lines, show only a partial prefix. This is independent of --full-index option above, which controls the diff-patch output format. Non default number of digits can be specified with --abbrev=. -- cgit v1.2.3 From 2b6a5417d750d086d1da906e46de2b3ad8df6753 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 17 Jan 2009 17:29:45 +0100 Subject: color-words: take an optional regular expression describing words In some applications, words are not delimited by white space. To allow for that, you can specify a regular expression describing what makes a word with git diff --color-words='[A-Za-z0-9]+' Note that words cannot contain newline characters. As suggested by Thomas Rast, the words are the exact matches of the regular expression. Note that a regular expression beginning with a '^' will match only a word at the beginning of the hunk, not a word at the beginning of a line, and is probably not what you want. This commit contains a quoting fix by Thomas Rast. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 43793d7500..2c1fa4b102 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -91,8 +91,12 @@ endif::git-format-patch[] Turn off colored diff, even when the configuration file gives the default to color output. ---color-words:: +--color-words[=regex]:: Show colored word diff, i.e. color words which have changed. ++ +Optionally, you can pass a regular expression that tells Git what the +words are that you are looking for; The default is to interpret any +stretch of non-whitespace as a word. --no-renames:: Turn off rename detection, even when the configuration -- cgit v1.2.3 From c4b252c3d894673968b144d8e10b79ef22c17b0a Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Sat, 17 Jan 2009 17:29:47 +0100 Subject: color-words: expand docs with precise semantics Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 2c1fa4b102..8689a92d8d 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -91,12 +91,17 @@ endif::git-format-patch[] Turn off colored diff, even when the configuration file gives the default to color output. ---color-words[=regex]:: - Show colored word diff, i.e. color words which have changed. +--color-words[=]:: + Show colored word diff, i.e., color words which have changed. + By default, words are separated by whitespace. + -Optionally, you can pass a regular expression that tells Git what the -words are that you are looking for; The default is to interpret any -stretch of non-whitespace as a word. +When a is specified, every non-overlapping match of the + is considered a word. Anything between these matches is +considered whitespace and ignored(!) for the purposes of finding +differences. You may want to append `|[^[:space:]]` to your regular +expression to make sure that it matches all non-whitespace characters. +A match that contains a newline is silently truncated(!) at the +newline. --no-renames:: Turn off rename detection, even when the configuration -- cgit v1.2.3 From 80c49c3de2d5a3aa12b0980a65f1163c8aef0c16 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Sat, 17 Jan 2009 17:29:48 +0100 Subject: color-words: make regex configurable via attributes Make the --color-words splitting regular expression configurable via the diff driver's 'wordregex' attribute. The user can then set the driver on a file in .gitattributes. If a regex is given on the command line, it overrides the driver's setting. We also provide built-in regexes for the languages that already had funcname patterns, and add an appropriate diff driver entry for C/++. (The patterns are designed to run UTF-8 sequences into a single chunk to make sure they remain readable.) Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 8689a92d8d..1edb82e8e1 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -102,6 +102,10 @@ differences. You may want to append `|[^[:space:]]` to your regular expression to make sure that it matches all non-whitespace characters. A match that contains a newline is silently truncated(!) at the newline. ++ +The regex can also be set via a diff driver, see +linkgit:gitattributes[1]; giving it explicitly overrides any diff +driver setting. --no-renames:: Turn off rename detection, even when the configuration -- cgit v1.2.3 From 98a4d87b87e9846eafd21ba232cc2b7ba3f718fc Mon Sep 17 00:00:00 2001 From: Boyd Stephen Smith Jr Date: Tue, 20 Jan 2009 21:46:57 -0600 Subject: color-words: Support diff.wordregex config option When diff is invoked with --color-words (w/o =regex), use the regular expression the user has configured as diff.wordregex. diff drivers configured via attributes take precedence over the diff.wordregex-words setting. If the user wants to change them, they have their own configuration variables. Signed-off-by: Boyd Stephen Smith Jr Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 1edb82e8e1..164e2c5348 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -103,9 +103,10 @@ expression to make sure that it matches all non-whitespace characters. A match that contains a newline is silently truncated(!) at the newline. + -The regex can also be set via a diff driver, see -linkgit:gitattributes[1]; giving it explicitly overrides any diff -driver setting. +The regex can also be set via a diff driver or configuration option, see +linkgit:gitattributes[1] or linkgit:git-config[1]. Giving it explicitly +overrides any diff driver or configuration setting. Diff drivers +override configuration settings. --no-renames:: Turn off rename detection, even when the configuration -- cgit v1.2.3 From ec74042dc7d81238d2c6d898331ff3b7e12a5d75 Mon Sep 17 00:00:00 2001 From: Teemu Likonen Date: Sun, 25 Jan 2009 14:20:22 +0200 Subject: diff-options.txt: Fix asciidoc markup issue Must be "--patience::", not "--patience:". Signed-off-by: Teemu Likonen Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 1f8ce979bb..a8ed23e7f8 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -36,7 +36,7 @@ endif::git-format-patch[] --patch-with-raw:: Synonym for "-p --raw". ---patience: +--patience:: Generate a diff using the "patience diff" algorithm. --stat[=width[,name-width]]:: -- cgit v1.2.3 From 821d56aa68c38f7390b3171092f7b8b814357194 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 3 Mar 2009 10:40:41 -0500 Subject: doc: clarify how -S works The existing text was very vague about what exactly it means for difference to "contain" a change. This seems to cause confusion on the mailing list every month or two. To fix it we: 1. use "introduce or remove an instance of" instead of "contain" 2. point the user to gitdiffcore(7), which contains a more complete explanation Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 813a7b11b9..9276faeb11 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -176,7 +176,10 @@ override configuration settings. number. -S:: - Look for differences that contain the change in . + Look for differences that introduce or remove an instance of + . Note that this is different than the string simply + appearing in diff output; see the 'pickaxe' entry in + linkgit:gitdiffcore[7] for more details. --pickaxe-all:: When -S finds a change, show all the changes in that -- cgit v1.2.3