From: Junio C Hamano Date: Sat, 28 May 2005 09:53:43 +0000 (-0700) Subject: [PATCH] Pickaxe fixes. X-Git-Tag: v0.99~422 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e25de75696dc99f327c8dd8e2cba937939e281ca;p=git.git [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 Signed-off-by: Linus Torvalds --- diff --git a/Documentation/git-diff-cache.txt b/Documentation/git-diff-cache.txt index 35253b11b..0e2e6d0a9 100644 --- a/Documentation/git-diff-cache.txt +++ b/Documentation/git-diff-cache.txt @@ -9,7 +9,7 @@ git-diff-cache - Compares content and mode of blobs between the cache and reposi SYNOPSIS -------- -'git-diff-cache' [-p] [-r] [-z] [-m] [-M] [-R] [-C] [-S] [--cached] [...] +'git-diff-cache' [-p] [-r] [-z] [-m] [-M] [-R] [-C] [-S] [--pickaxe-all] [--cached] [...] DESCRIPTION ----------- @@ -44,6 +44,10 @@ OPTIONS -S:: Look for differences that contains the change in . +--pickaxe-all:: + When -S finds a change, show all the changes in that + changeset, not just the files that contains the change + in . -R:: Output diff in reverse. diff --git a/Documentation/git-diff-files.txt b/Documentation/git-diff-files.txt index 9f9bb1453..701364024 100644 --- a/Documentation/git-diff-files.txt +++ b/Documentation/git-diff-files.txt @@ -9,7 +9,7 @@ git-diff-files - Compares files in the working tree and the cache SYNOPSIS -------- -'git-diff-files' [-p] [-q] [-r] [-z] [-M] [-C] [-R] [-S] [...] +'git-diff-files' [-p] [-q] [-r] [-z] [-M] [-C] [-R] [-S] [--pickaxe-all] [...] DESCRIPTION ----------- @@ -38,6 +38,10 @@ OPTIONS -S:: Look for differences that contains the change in . +--pickaxe-all:: + When -S finds a change, show all the changes in that + changeset, not just the files that contains the change + in . -r:: This flag does not mean anything. It is there only to match diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt index 77b1fb179..f44e8cf13 100644 --- a/Documentation/git-diff-tree.txt +++ b/Documentation/git-diff-tree.txt @@ -9,7 +9,7 @@ git-diff-tree - Compares the content and mode of blobs found via two tree object SYNOPSIS -------- -'git-diff-tree' [-p] [-r] [-z] [--stdin] [-M] [-R] [-C] [-S] [-m] [-s] [-v] [-t] []\* +'git-diff-tree' [-p] [-r] [-z] [--stdin] [-M] [-R] [-C] [-S] [--pickaxe-all] [-m] [-s] [-v] [-t] []\* DESCRIPTION ----------- @@ -45,6 +45,11 @@ OPTIONS -S:: Look for differences that contains the change in . +--pickaxe-all:: + When -S finds a change, show all the changes in that + changeset, not just the files that contains the change + in . + -r:: recurse diff --git a/diff-cache.c b/diff-cache.c index 66e7bdb62..1e0fda529 100644 --- a/diff-cache.c +++ b/diff-cache.c @@ -206,7 +206,7 @@ int main(int argc, const char **argv) diff_setup_opt |= DIFF_SETUP_REVERSE; continue; } - if (!strcmp(arg, "-S")) { + if (!strncmp(arg, "-S", 2)) { pickaxe = arg + 2; continue; } diff --git a/diff-files.c b/diff-files.c index bd0eb95f8..8ab791597 100644 --- a/diff-files.c +++ b/diff-files.c @@ -53,7 +53,7 @@ int main(int argc, const char **argv) diff_output_format = DIFF_FORMAT_MACHINE; else if (!strcmp(argv[1], "-R")) diff_setup_opt |= DIFF_SETUP_REVERSE; - else if (!strcmp(argv[1], "-S")) + else if (!strncmp(argv[1], "-S", 2)) pickaxe = argv[1] + 2; else if (!strcmp(argv[1], "--pickaxe-all")) pickaxe_opts = DIFF_PICKAXE_ALL;