Skip to content

Improve diffcore-pickaxe documentation

Ramkumar Ramachandra git 4 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 2 repliesIn review
  2. v32 patches 4 repliesSuperseded
  3. v22 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch2 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2diffcore-pickaxe: make error messages more consistentdiffcore-pickaxe.c+2 -21 reply
2/2diffcore-pickaxe doc: document -S and -G properlyDocumentation/diff-options.txt Documentation/gitdiffcore.txt+57 -261 reply

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchJunio C Hamano
1/2
2/2Co-authored-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/2] Improve diffcore-pickaxe documentation

Junio had some suggestions in the previous round. The inter-diff follows.

Yeah, word-diff is a bit messy. Which brings me to: is it possible to turn on word-diff only where heuristically appropriate? word-diff applied on the rewrite of the first paragraph of gitdiffcore.txt is a disaster, but okay everywhere else.

Documentation/diff-options.txt +0 -0
index efb5dfe..a85288f 100644
@@ -387,11 +387,11 @@ ifndef::git-format-patch[]

the specified string (i.e. addition/deletion) in a file. Intended for the scripter's use.
+
It is[-especially-] useful when you're looking for an exact block of code (like a struct), and want to know the history of that block since it first came into being: use the feature iteratively to feed the interesting block in the preimage back into -S, and keep going until you get the very first version of the block.

-G<regex>::
Look for differences whose patch text contains added/removed

Documentation/gitdiffcore.txt +0 -0
index ef4c04a..c8b3e51 100644
@@ -222,25 +222,27 @@ version prefixed with '+'.

diffcore-pickaxe: For Detecting Addition/Deletion of Specified String
---------------------------------------------------------------------

[-There are two kinds of pickaxe:-]{+This transformation limits+} the [-S kind (corresponding-]{+set of filepairs+} to [-'git log-] [--S')-]{+those that change+}
{+specified strings between the preimage+} and the [-G kind (mnemonic: grep; corresponding-]{+postimage in a certain+} {+way. -S<block of text> and -G<regular expression> options are used+} to
[-'git log -G').-]{+specify different ways these strings are sought.+}

"-S<block of text>" detects filepairs whose preimage and postimage
have different number of occurrences of the specified block of text.
By definition, it will not detect in-file moves. Also, when a
changeset moves a file wholesale without affecting the interesting
string, [-rename detection-]{+diffcore-rename+} kicks in as usual, and -S omits the filepair (since the number of occurrences of that string didn't change in that
rename-detected filepair).[-The implementation essentially-]
[-runs a count, and is significantly cheaper than the G kind.-] When used with --pickaxe-regex, treat the <block of text> as an extended POSIX regular expression to match,
instead of a literal string.

"-G<regular expression>" {+(mnemonic: grep)+} detects filepairs whose textual diff has an added or a deleted line that matches the given regular expression. This means that it [-can-]{+will+} detect in-file (or what rename-detection considers the same file) [-moves.-]{+moves, which is noise.+} The implementation runs diff twice and greps, and this can be quite expensive.

When -S or -G are used without --pickaxe-all, only filepairs that match their respective criterion are kept in the output. When

Ramkumar Ramachandra (2):
diffcore-pickaxe: make error messages more consistent diffcore-pickaxe doc: document -S and -G properly

 Documentation/diff-options.txt | 38 +++++++++++++++++++++++++++--------
 Documentation/gitdiffcore.txt  | 45 +++++++++++++++++++++++++-----------------
 diffcore-pickaxe.c             |  4 ++--
 3 files changed, 59 insertions(+), 28 deletions(-)
Signature · 1 line
1.8.3.114.gcd03571