@matheusbsbs / matheus-bagliano / commits / 59df2a11fe
Fork 0

Minor clarifications in diffcore documentation

Signed-off-by: Chris Shoemaker <c.shoemaker at cox.net> Signed-off-by: Junio C Hamano <junkio@cox.net>

c.shoemaker@cox.net committed Oct 29, 2005 at 00:15 UTC 59df2a11fea918dd605bd805c233b193a134e59e
1 file changed +38 -27
Documentation/diffcore.txt
+38 -27
@@ -6,13 +6,12 @@ June 2005
6 Introduction
7 ------------
8
9 -The diff commands git-diff-index, git-diff-files, and
10 -git-diff-tree can be told to manipulate differences they find
11 -in unconventional ways before showing diff(1) output. The
12 -manipulation is collectively called "diffcore transformation".
13 -This short note describes what they are and how to use them to
14 -produce diff outputs that are easier to understand than the
15 -conventional kind.
9 +The diff commands git-diff-index, git-diff-files, git-diff-tree, and
10 +git-diff-stages can be told to manipulate differences they find in
11 +unconventional ways before showing diff(1) output. The manipulation
12 +is collectively called "diffcore transformation". This short note
13 +describes what they are and how to use them to produce diff outputs
14 +that are easier to understand than the conventional kind.
15
16
17 The chain of operation
@@ -29,7 +28,10 @@ files:
28 - git-diff-files compares contents of the index file and the
29 working directory;
30
32 - - git-diff-tree compares contents of two "tree" objects.
31 + - git-diff-tree compares contents of two "tree" objects;
32 +
33 + - git-diff-stages compares contents of blobs at two stages in an
34 + unmerged index file.
35
36 In all of these cases, the commands themselves compare
37 corresponding paths in the two sets of files. The result of
@@ -65,14 +67,23 @@ format sections of the manual for git-diff-\* commands) or
67 diff-patch format.
68
69
68 -diffcore-pathspec
70 +diffcore-pathspec: For Ignoring Files Outside Our Consideration
71 -----------------
72
73 The first transformation in the chain is diffcore-pathspec, and
74 is controlled by giving the pathname parameters to the
75 git-diff-* commands on the command line. The pathspec is used
76 to limit the world diff operates in. It removes the filepairs
75 -outside the specified set of pathnames.
77 +outside the specified set of pathnames. E.g. If the input set
78 +of filepairs included:
79 +
80 +------------------------------------------------
81 +:100644 100644 bcd1234... 0123456... M junkfile
82 +------------------------------------------------
83 +
84 +but the command invocation was "git-diff-files myfile", then the
85 +junkfile entry would be removed from the list because only "myfile"
86 +is under consideration.
87
88 Implementation note. For performance reasons, git-diff-tree
89 uses the pathname parameters on the command line to cull set of
@@ -80,7 +91,7 @@ filepairs it feeds the diffcore mechanism itself, and does not
91 use diffcore-pathspec, but the end result is the same.
92
93
83 -diffcore-break
94 +diffcore-break: For Splitting Up "Complete Rewrites"
95 --------------
96
97 The second transformation in the chain is diffcore-break, and is
@@ -115,7 +126,7 @@ the original is used), and can be customized by giving a number
126 after "-B" option (e.g. "-B75" to tell it to use 75%).
127
128
118 -diffcore-rename
129 +diffcore-rename: For Detection Renames and Copies
130 ---------------
131
132 This transformation is used to detect renames and copies, and is
@@ -136,16 +147,16 @@ merges these filepairs and creates:
147 :100644 100644 0123456... 0123456... R100 fileX file0
148 ------------------------------------------------
149
139 -When the "-C" option is used, the original contents of modified
140 -files and contents of unchanged files are considered as
141 -candidates of the source files in rename/copy operation, in
142 -addition to the deleted files. If the input were like these
143 -filepairs, that talk about a modified file fileY and a newly
150 +When the "-C" option is used, the original contents of modified files,
151 +and deleted files (and also unmodified files, if the
152 +"\--find-copies-harder" option is used) are considered as candidates
153 +of the source files in rename/copy operation. If the input were like
154 +these filepairs, that talk about a modified file fileY and a newly
155 created file file0:
156
157 ------------------------------------------------
158 :100644 100644 0123456... 1234567... M fileY
148 -:000000 100644 0000000... 0123456... A file0
159 +:000000 100644 0000000... bcd3456... A file0
160 ------------------------------------------------
161
162 the original contents of fileY and the resulting contents of
@@ -154,14 +165,14 @@ changed to:
165
166 ------------------------------------------------
167 :100644 100644 0123456... 1234567... M fileY
157 -:100644 100644 0123456... 0123456... C100 fileY file0
168 +:100644 100644 0123456... bcd3456... C100 fileY file0
169 ------------------------------------------------
170
171 In both rename and copy detection, the same "extent of changes"
172 algorithm used in diffcore-break is used to determine if two
173 files are "similar enough", and can be customized to use
163 -similarity score different from the default 50% by giving a
164 -number after "-M" or "-C" option (e.g. "-M8" to tell it to use
174 +a similarity score different from the default of 50% by giving a
175 +number after the "-M" or "-C" option (e.g. "-M8" to tell it to use
176 8/10 = 80%).
177
178 Note. When the "-C" option is used with `\--find-copies-harder`
@@ -173,7 +184,7 @@ git-diff-\* commands can detect copies only if the file that was
184 copied happened to have been modified in the same changeset.
185
186
176 -diffcore-merge-broken
187 +diffcore-merge-broken: For Putting "Complete Rewrites" Back Together
188 ---------------------
189
190 This transformation is used to merge filepairs broken by
@@ -215,7 +226,7 @@ prefixed with '-', followed by the entire contents of new
226 version prefixed with '+'.
227
228
218 -diffcore-pickaxe
229 +diffcore-pickaxe: For Detecting Addition/Deletion of Specified String
230 ----------------
231
232 This transformation is used to find filepairs that represent
@@ -230,7 +241,7 @@ string appeared in this changeset". It also checks for the
241 opposite case that loses the specified string.
242
243 When `\--pickaxe-all` is not in effect, diffcore-pickaxe leaves
233 -only such filepairs that touches the specified string in its
244 +only such filepairs that touch the specified string in its
245 output. When `\--pickaxe-all` is used, diffcore-pickaxe leaves all
246 filepairs intact if there is such a filepair, or makes the
247 output empty otherwise. The latter behaviour is designed to
@@ -238,19 +249,19 @@ make reviewing of the changes in the context of the whole
249 changeset easier.
250
251
241 -diffcore-order
252 +diffcore-order: For Sorting the Output Based on Filenames
253 --------------
254
255 This is used to reorder the filepairs according to the user's
256 (or project's) taste, and is controlled by the -O option to the
257 git-diff-* commands.
258
248 -This takes a text file each of whose line is a shell glob
259 +This takes a text file each of whose lines is a shell glob
260 pattern. Filepairs that match a glob pattern on an earlier line
261 in the file are output before ones that match a later line, and
262 filepairs that do not match any glob pattern are output last.
263
253 -As an example, typical orderfile for the core git probably
264 +As an example, a typical orderfile for the core git probably
265 would look like this:
266
267 ------------------------------------------------