@@ -222,26 +222,35 @@ version prefixed with '+'.
222
222
diffcore-pickaxe: For Detecting Addition/Deletion of Specified String
223
223
---------------------------------------------------------------------
224
224
225
- This transformation is used to find filepairs that represent
226
- changes that touch a specified string, and is controlled by the
227
- -S option and the `--pickaxe-all` option to the 'git diff-*'
228
- commands.
229
-
230
- When diffcore-pickaxe is in use, it checks if there are
231
- filepairs whose "result" side and whose "origin" side have
232
- different number of specified string. Such a filepair represents
233
- "the string appeared in this changeset". It also checks for the
234
- opposite case that loses the specified string.
235
-
236
- When `--pickaxe-all` is not in effect, diffcore-pickaxe leaves
237
- only such filepairs that touch the specified string in its
238
- output. When `--pickaxe-all` is used, diffcore-pickaxe leaves all
239
- filepairs intact if there is such a filepair, or makes the
240
- output empty otherwise. The latter behaviour is designed to
241
- make reviewing of the changes in the context of the whole
225
+ This transformation limits the set of filepairs to those that change
226
+ specified strings between the preimage and the postimage in a certain
227
+ way. -S<block of text> and -G<regular expression> options are used to
228
+ specify different ways these strings are sought.
229
+
230
+ "-S<block of text>" detects filepairs whose preimage and postimage
231
+ have different number of occurrences of the specified block of text.
232
+ By definition, it will not detect in-file moves. Also, when a
233
+ changeset moves a file wholesale without affecting the interesting
234
+ string, diffcore-rename kicks in as usual, and `-S` omits the filepair
235
+ (since the number of occurrences of that string didn't change in that
236
+ rename-detected filepair). When used with `--pickaxe-regex`, treat
237
+ the <block of text> as an extended POSIX regular expression to match,
238
+ instead of a literal string.
239
+
240
+ "-G<regular expression>" (mnemonic: grep) detects filepairs whose
241
+ textual diff has an added or a deleted line that matches the given
242
+ regular expression. This means that it will detect in-file (or what
243
+ rename-detection considers the same file) moves, which is noise. The
244
+ implementation runs diff twice and greps, and this can be quite
245
+ expensive.
246
+
247
+ When `-S` or `-G` are used without `--pickaxe-all`, only filepairs
248
+ that match their respective criterion are kept in the output. When
249
+ `--pickaxe-all` is used, if even one filepair matches their respective
250
+ criterion in a changeset, the entire changeset is kept. This behavior
251
+ is designed to make reviewing changes in the context of the whole
242
252
changeset easier.
243
253
244
-
245
254
diffcore-order: For Sorting the Output Based on Filenames
246
255
---------------------------------------------------------
247
256
0 commit comments