diff options
author | Junio C Hamano <junkio@cox.net> | 2005-05-27 15:55:28 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-29 11:17:43 -0700 |
commit | 367cec1c024c3849cb32eaac15884a4adfefe1de (patch) | |
tree | ff5ff9663406484cfac8d6dee415971e62eba8ef /diff-helper.c | |
parent | be020332a152ef95e0e8435fb69d8c02d5da29bb (diff) | |
download | git-367cec1c024c3849cb32eaac15884a4adfefe1de.tar.gz |
[PATCH] Add --pickaxe-all to diff-* brothers.
When --pickaxe-all is given in addition to -S, pickaxe shows the
entire diffs contained in the changeset, not just the diffs for
the filepair that touched the sought-after string. This is
useful to see the changes in context.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'diff-helper.c')
-rw-r--r-- | diff-helper.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/diff-helper.c b/diff-helper.c index 4da2614fc6..03ac9104cd 100644 --- a/diff-helper.c +++ b/diff-helper.c @@ -6,6 +6,7 @@ #include "diff.h" static const char *pickaxe = NULL; +static int pickaxe_opts = 0; static int line_termination = '\n'; static int inter_name_termination = '\t'; @@ -23,6 +24,8 @@ int main(int ac, const char **av) { else if (av[1][1] == 'S') { pickaxe = av[1] + 2; } + else if (!strcmp(av[1], "--pickaxe-all")) + pickaxe_opts = DIFF_PICKAXE_ALL; else usage(diff_helper_usage); ac--; av++; @@ -127,14 +130,14 @@ int main(int ac, const char **av) { continue; } if (pickaxe) - diffcore_pickaxe(pickaxe); + diffcore_pickaxe(pickaxe, pickaxe_opts); if (1 < ac) diffcore_pathspec(av + 1); diff_flush(DIFF_FORMAT_PATCH, 0); printf("%s\n", sb.buf); } if (pickaxe) - diffcore_pickaxe(pickaxe); + diffcore_pickaxe(pickaxe, pickaxe_opts); if (1 < ac) diffcore_pathspec(av + 1); diff_flush(DIFF_FORMAT_PATCH, 0); |