diff options
Diffstat (limited to 'Documentation/gitdiffcore.txt')
-rw-r--r-- | Documentation/gitdiffcore.txt | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt index e8041bc08f..daf1782a31 100644 --- a/Documentation/gitdiffcore.txt +++ b/Documentation/gitdiffcore.txt @@ -3,16 +3,17 @@ gitdiffcore(7) NAME ---- -gitdiffcore - Tweaking diff output (June 2005) +gitdiffcore - Tweaking diff output SYNOPSIS -------- +[verse] 'git diff' * DESCRIPTION ----------- -The diff commands 'git-diff-index', 'git-diff-files', and 'git-diff-tree' +The diff commands 'git diff-index', 'git diff-files', and 'git diff-tree' can be told to manipulate differences they find in unconventional ways before showing 'diff' output. The manipulation is collectively called "diffcore transformation". This short note @@ -23,18 +24,18 @@ that is easier to understand than the conventional kind. The chain of operation ---------------------- -The 'git-diff-{asterisk}' family works by first comparing two sets of +The 'git diff-{asterisk}' family works by first comparing two sets of files: - - 'git-diff-index' compares contents of a "tree" object and the + - 'git diff-index' compares contents of a "tree" object and the working directory (when '\--cached' flag is not used) or a "tree" object and the index file (when '\--cached' flag is used); - - 'git-diff-files' compares contents of the index file and the + - 'git diff-files' compares contents of the index file and the working directory; - - 'git-diff-tree' compares contents of two "tree" objects; + - 'git diff-tree' compares contents of two "tree" objects; In all of these cases, the commands themselves first optionally limit the two sets of files by any pathspecs given on their command-lines, @@ -74,12 +75,12 @@ into another list. There are currently 5 such transformations: - diffcore-pickaxe - diffcore-order -These are applied in sequence. The set of filepairs 'git-diff-{asterisk}' +These are applied in sequence. The set of filepairs 'git diff-{asterisk}' commands find are used as the input to diffcore-break, and the output from diffcore-break is used as the input to the next transformation. The final result is then passed to the output routine and generates either diff-raw format (see Output -format sections of the manual for 'git-diff-{asterisk}' commands) or +format sections of the manual for 'git diff-{asterisk}' commands) or diff-patch format. @@ -87,7 +88,7 @@ diffcore-break: For Splitting Up "Complete Rewrites" ---------------------------------------------------- The second transformation in the chain is diffcore-break, and is -controlled by the -B option to the 'git-diff-{asterisk}' commands. This is +controlled by the -B option to the 'git diff-{asterisk}' commands. This is used to detect a filepair that represents "complete rewrite" and break such filepair into two filepairs that represent delete and create. E.g. If the input contained this filepair: @@ -123,7 +124,7 @@ diffcore-rename: For Detection Renames and Copies This transformation is used to detect renames and copies, and is controlled by the -M option (to detect renames) and the -C option -(to detect copies as well) to the 'git-diff-{asterisk}' commands. If the +(to detect copies as well) to the 'git diff-{asterisk}' commands. If the input contained these filepairs: ------------------------------------------------ @@ -167,12 +168,12 @@ a similarity score different from the default of 50% by giving a number after the "-M" or "-C" option (e.g. "-M8" to tell it to use 8/10 = 80%). -Note. When the "-C" option is used with `\--find-copies-harder` -option, 'git-diff-{asterisk}' commands feed unmodified filepairs to +Note. When the "-C" option is used with `--find-copies-harder` +option, 'git diff-{asterisk}' commands feed unmodified filepairs to diffcore mechanism as well as modified ones. This lets the copy detector consider unmodified files as copy source candidates at -the expense of making it slower. Without `\--find-copies-harder`, -'git-diff-{asterisk}' commands can detect copies only if the file that was +the expense of making it slower. Without `--find-copies-harder`, +'git diff-{asterisk}' commands can detect copies only if the file that was copied happened to have been modified in the same changeset. @@ -223,18 +224,18 @@ diffcore-pickaxe: For Detecting Addition/Deletion of Specified String This transformation is used to find filepairs that represent changes that touch a specified string, and is controlled by the --S option and the `\--pickaxe-all` option to the 'git-diff-{asterisk}' +-S option and the `--pickaxe-all` option to the 'git diff-*' commands. When diffcore-pickaxe is in use, it checks if there are -filepairs whose "original" side has the specified string and -whose "result" side does not. Such a filepair represents "the -string appeared in this changeset". It also checks for the +filepairs whose "result" side and whose "origin" side have +different number of specified string. Such a filepair represents +"the string appeared in this changeset". It also checks for the opposite case that loses the specified string. -When `\--pickaxe-all` is not in effect, diffcore-pickaxe leaves +When `--pickaxe-all` is not in effect, diffcore-pickaxe leaves only such filepairs that touch the specified string in its -output. When `\--pickaxe-all` is used, diffcore-pickaxe leaves all +output. When `--pickaxe-all` is used, diffcore-pickaxe leaves all filepairs intact if there is such a filepair, or makes the output empty otherwise. The latter behaviour is designed to make reviewing of the changes in the context of the whole @@ -246,7 +247,7 @@ diffcore-order: For Sorting the Output Based on Filenames This is used to reorder the filepairs according to the user's (or project's) taste, and is controlled by the -O option to the -'git-diff-{asterisk}' commands. +'git diff-{asterisk}' commands. This takes a text file each of whose lines is a shell glob pattern. Filepairs that match a glob pattern on an earlier line |