{"thread":{"id":"744","subject":"[PATCH] Pickaxe fixes.","startedAt":"2005-05-28T09:53:43Z","lastAt":"2005-05-28T09:53:43Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4127","messageId":"7v7jhjy8uw.fsf@assigned-by-dhcp.cox.net","threadId":"744","inReplyTo":null,"subject":"[PATCH] Pickaxe fixes.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-28T09:53:43Z","receivedAt":"2005-05-28T09:53:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"A bug in the command line argument parsing code was making\npickaxe not to work at all in diff-cache and diff-files commands.\nEmbarrassingly enough, the working pickaxe in diff-tree tells me\nthat it was not working in these two commands from day one.\nThis patch fixes it.\n\nAlso updates the documentation to describe the --pickaxe-all option.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\nDocumentation/git-diff-cache.txt |    6 +++++-\nDocumentation/git-diff-files.txt |    6 +++++-\nDocumentation/git-diff-tree.txt  |    7 ++++++-\ndiff-cache.c                     |    2 +-\ndiff-files.c                     |    2 +-\n5 files changed, 18 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/git-diff-cache.txt b/Documentation/git-diff-cache.txt\n--- a/Documentation/git-diff-cache.txt\n+++ b/Documentation/git-diff-cache.txt\n@@ -9,7 +9,7 @@ git-diff-cache - Compares content and mo\n \n SYNOPSIS\n --------\n-'git-diff-cache' [-p] [-r] [-z] [-m] [-M] [-R] [-C] [-S<string>] [--cached] <tree-ish> [<path>...]\n+'git-diff-cache' [-p] [-r] [-z] [-m] [-M] [-R] [-C] [-S<string>] [--pickaxe-all] [--cached] <tree-ish> [<path>...]\n \n DESCRIPTION\n -----------\n@@ -44,6 +44,10 @@ OPTIONS\n -S<string>::\n \tLook for differences that contains the change in <string>.\n \n+--pickaxe-all::\n+\tWhen -S finds a change, show all the changes in that\n+\tchangeset, not just the files that contains the change\n+\tin <string>.\n \n -R::\n \tOutput diff in reverse.\ndiff --git a/Documentation/git-diff-files.txt b/Documentation/git-diff-files.txt\n--- a/Documentation/git-diff-files.txt\n+++ b/Documentation/git-diff-files.txt\n@@ -9,7 +9,7 @@ git-diff-files - Compares files in the w\n \n SYNOPSIS\n --------\n-'git-diff-files' [-p] [-q] [-r] [-z] [-M] [-C] [-R] [-S<string>] [<pattern>...]\n+'git-diff-files' [-p] [-q] [-r] [-z] [-M] [-C] [-R] [-S<string>] [--pickaxe-all] [<pattern>...]\n \n DESCRIPTION\n -----------\n@@ -38,6 +38,10 @@ OPTIONS\n -S<string>::\n \tLook for differences that contains the change in <string>.\n \n+--pickaxe-all::\n+\tWhen -S finds a change, show all the changes in that\n+\tchangeset, not just the files that contains the change\n+\tin <string>.\n \n -r::\n \tThis flag does not mean anything.  It is there only to match\ndiff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt\n--- a/Documentation/git-diff-tree.txt\n+++ b/Documentation/git-diff-tree.txt\n@@ -9,7 +9,7 @@ git-diff-tree - Compares the content and\n \n SYNOPSIS\n --------\n-'git-diff-tree' [-p] [-r] [-z] [--stdin] [-M] [-R] [-C] [-S<string>] [-m] [-s] [-v] [-t] <tree-ish> <tree-ish> [<pattern>]\\*\n+'git-diff-tree' [-p] [-r] [-z] [--stdin] [-M] [-R] [-C] [-S<string>] [--pickaxe-all] [-m] [-s] [-v] [-t] <tree-ish> <tree-ish> [<pattern>]\\*\n \n DESCRIPTION\n -----------\n@@ -45,6 +45,11 @@ OPTIONS\n -S<string>::\n \tLook for differences that contains the change in <string>.\n \n+--pickaxe-all::\n+\tWhen -S finds a change, show all the changes in that\n+\tchangeset, not just the files that contains the change\n+\tin <string>.\n+\n -r::\n \trecurse\n \ndiff --git a/diff-cache.c b/diff-cache.c\n--- a/diff-cache.c\n+++ b/diff-cache.c\n@@ -206,7 +206,7 @@ int main(int argc, const char **argv)\n \t\t\tdiff_setup_opt |= DIFF_SETUP_REVERSE;\n \t\t\tcontinue;\n \t\t}\n-\t\tif (!strcmp(arg, \"-S\")) {\n+\t\tif (!strncmp(arg, \"-S\", 2)) {\n \t\t\tpickaxe = arg + 2;\n \t\t\tcontinue;\n \t\t}\ndiff --git a/diff-files.c b/diff-files.c\n--- a/diff-files.c\n+++ b/diff-files.c\n@@ -53,7 +53,7 @@ int main(int argc, const char **argv)\n \t\t\tdiff_output_format = DIFF_FORMAT_MACHINE;\n \t\telse if (!strcmp(argv[1], \"-R\"))\n \t\t\tdiff_setup_opt |= DIFF_SETUP_REVERSE;\n-\t\telse if (!strcmp(argv[1], \"-S\"))\n+\t\telse if (!strncmp(argv[1], \"-S\", 2))\n \t\t\tpickaxe = argv[1] + 2;\n \t\telse if (!strcmp(argv[1], \"--pickaxe-all\"))\n \t\t\tpickaxe_opts = DIFF_PICKAXE_ALL;\n------------------------------------------------\n\n"}]}