From a2c2cef0cd5210aa870e1d226d348a7ddd0277ff Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 31 Aug 2010 14:16:39 -0700 Subject: gitdiffcore doc: update pickaxe description The old text described the original design (one side does not have it at all while the other side has it); this was later amended to check if the number of occurrences changed, which is what we currently do with -S. Signed-off-by: Junio C Hamano --- Documentation/gitdiffcore.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Documentation') diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt index 5d91a7e5b3..6af29a4603 100644 --- a/Documentation/gitdiffcore.txt +++ b/Documentation/gitdiffcore.txt @@ -227,9 +227,9 @@ changes that touch a specified string, and is controlled by the commands. When diffcore-pickaxe is in use, it checks if there are -filepairs whose "result" side has the specified string and -whose "origin" 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 -- cgit v1.2.1 From f506b8e8b5fb231e63b69668b6b7516f12b32228 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 23 Aug 2010 10:17:03 -0700 Subject: git log/diff: add -G that greps in the patch text Teach "-G" that is similar to "-S --pickaxe-regexp" to the "git diff" family of commands. This limits the diff queue to filepairs whose patch text actually has an added or a deleted line that matches the given regexp. Unlike "-S", changing other parts of the line that has a substring that matches the given regexp IS counted as a change, as such a change would appear as one deletion followed by one addition in a patch text. Unlike -S (pickaxe) that is intended to be used to quickly detect a commit that changes the number of occurrences of hits between the preimage and the postimage to serve as a part of larger toolchain, this is meant to be used as the top-level Porcelain feature. The implementation unfortunately has to run "diff" twice if you are running "log" family of commands to produce patches in the final output (e.g. "git log -p" or "git format-patch"). I think we _could_ cache the result in-core if we wanted to, but that would require larger surgery to the diffcore machinery (i.e. adding an extra pointer in the filepair structure to keep a pointer to a strbuf around, stuff the textual diff to the strbuf inside diffgrep_consume(), and make use of it in later stages when it is available) and it may not be worth it. Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 4656a97e60..f77a0f8749 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -284,8 +284,12 @@ ifndef::git-format-patch[] appearing in diff output; see the 'pickaxe' entry in linkgit:gitdiffcore[7] for more details. +-G:: + Look for differences whose added or removed line matches + the given . + --pickaxe-all:: - When `-S` finds a change, show all the changes in that + When `-S` or `-G` finds a change, show all the changes in that changeset, not just the files that contain the change in . -- cgit v1.2.1