Skip to content

Commit e25de75

Browse files
Junio C HamanoLinus Torvalds
authored andcommitted
[PATCH] Pickaxe fixes.
A bug in the command line argument parsing code was making pickaxe not to work at all in diff-cache and diff-files commands. Embarrassingly enough, the working pickaxe in diff-tree tells me that it was not working in these two commands from day one. This patch fixes it. Also updates the documentation to describe the --pickaxe-all option. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 6af1f01 commit e25de75

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

Documentation/git-diff-cache.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-diff-cache - Compares content and mode of blobs between the cache and reposi
99

1010
SYNOPSIS
1111
--------
12-
'git-diff-cache' [-p] [-r] [-z] [-m] [-M] [-R] [-C] [-S<string>] [--cached] <tree-ish> [<path>...]
12+
'git-diff-cache' [-p] [-r] [-z] [-m] [-M] [-R] [-C] [-S<string>] [--pickaxe-all] [--cached] <tree-ish> [<path>...]
1313

1414
DESCRIPTION
1515
-----------
@@ -44,6 +44,10 @@ OPTIONS
4444
-S<string>::
4545
Look for differences that contains the change in <string>.
4646

47+
--pickaxe-all::
48+
When -S finds a change, show all the changes in that
49+
changeset, not just the files that contains the change
50+
in <string>.
4751

4852
-R::
4953
Output diff in reverse.

Documentation/git-diff-files.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-diff-files - Compares files in the working tree and the cache
99

1010
SYNOPSIS
1111
--------
12-
'git-diff-files' [-p] [-q] [-r] [-z] [-M] [-C] [-R] [-S<string>] [<pattern>...]
12+
'git-diff-files' [-p] [-q] [-r] [-z] [-M] [-C] [-R] [-S<string>] [--pickaxe-all] [<pattern>...]
1313

1414
DESCRIPTION
1515
-----------
@@ -38,6 +38,10 @@ OPTIONS
3838
-S<string>::
3939
Look for differences that contains the change in <string>.
4040

41+
--pickaxe-all::
42+
When -S finds a change, show all the changes in that
43+
changeset, not just the files that contains the change
44+
in <string>.
4145

4246
-r::
4347
This flag does not mean anything. It is there only to match

Documentation/git-diff-tree.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ git-diff-tree - Compares the content and mode of blobs found via two tree object
99

1010
SYNOPSIS
1111
--------
12-
'git-diff-tree' [-p] [-r] [-z] [--stdin] [-M] [-R] [-C] [-S<string>] [-m] [-s] [-v] [-t] <tree-ish> <tree-ish> [<pattern>]\*
12+
'git-diff-tree' [-p] [-r] [-z] [--stdin] [-M] [-R] [-C] [-S<string>] [--pickaxe-all] [-m] [-s] [-v] [-t] <tree-ish> <tree-ish> [<pattern>]\*
1313

1414
DESCRIPTION
1515
-----------
@@ -45,6 +45,11 @@ OPTIONS
4545
-S<string>::
4646
Look for differences that contains the change in <string>.
4747

48+
--pickaxe-all::
49+
When -S finds a change, show all the changes in that
50+
changeset, not just the files that contains the change
51+
in <string>.
52+
4853
-r::
4954
recurse
5055

diff-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ int main(int argc, const char **argv)
206206
diff_setup_opt |= DIFF_SETUP_REVERSE;
207207
continue;
208208
}
209-
if (!strcmp(arg, "-S")) {
209+
if (!strncmp(arg, "-S", 2)) {
210210
pickaxe = arg + 2;
211211
continue;
212212
}

diff-files.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ int main(int argc, const char **argv)
5353
diff_output_format = DIFF_FORMAT_MACHINE;
5454
else if (!strcmp(argv[1], "-R"))
5555
diff_setup_opt |= DIFF_SETUP_REVERSE;
56-
else if (!strcmp(argv[1], "-S"))
56+
else if (!strncmp(argv[1], "-S", 2))
5757
pickaxe = argv[1] + 2;
5858
else if (!strcmp(argv[1], "--pickaxe-all"))
5959
pickaxe_opts = DIFF_PICKAXE_ALL;

0 commit comments

Comments
 (0)