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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index efb5dfe..a85288f 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -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
diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt
index ef4c04a..c8b3e51 100644
--- a/Documentation/gitdiffcore.txt
+++ b/Documentation/gitdiffcore.txt
@@ -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(-)

-- 
1.8.3.114.gcd03571

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]