aboutsummaryrefslogtreecommitdiff
path: root/builtin-log.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-10 12:35:56 -0800
committerJunio C Hamano <gitster@pobox.com>2009-11-10 12:35:56 -0800
commit6a93158c334fae92c5ca969cd0d0725c90af6b54 (patch)
tree985b395452a3d8ceafe0110e42069339b890f219 /builtin-log.c
parenta12e3cf3a2dbe61d2fc68b67d0db7af947795036 (diff)
parent1d46f2ea143534e46e6bfee3f34cd90b734bfe80 (diff)
downloadgit-6a93158c334fae92c5ca969cd0d0725c90af6b54.tar.gz
git-6a93158c334fae92c5ca969cd0d0725c90af6b54.tar.xz
Merge branch 'jk/maint-format-patch-p-suppress-stat'
* jk/maint-format-patch-p-suppress-stat: format-patch: make "-p" suppress diffstat
Diffstat (limited to 'builtin-log.c')
-rw-r--r--builtin-log.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin-log.c b/builtin-log.c
index 207a36178..fb5308220 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -891,6 +891,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
struct patch_ids ids;
char *add_signoff = NULL;
struct strbuf buf = STRBUF_INIT;
+ int use_patch_format = 0;
const struct option builtin_format_patch_options[] = {
{ OPTION_CALLBACK, 'n', "numbered", &numbered, NULL,
"use [PATCH n/m] even with a single patch",
@@ -920,6 +921,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
PARSE_OPT_NOARG | PARSE_OPT_NONEG, keep_callback },
OPT_BOOLEAN(0, "no-binary", &no_binary_diff,
"don't output binary diffs"),
+ OPT_BOOLEAN('p', NULL, &use_patch_format,
+ "show patch format instead of default (patch + stat)"),
OPT_BOOLEAN(0, "ignore-if-in-upstream", &ignore_if_in_upstream,
"don't include a patch matching a commit upstream"),
OPT_GROUP("Messaging"),
@@ -1027,8 +1030,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
if (argc > 1)
die ("unrecognized argument: %s", argv[1]);
- if (!rev.diffopt.output_format
- || rev.diffopt.output_format == DIFF_FORMAT_PATCH)
+ if (use_patch_format)
+ rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
+ else if (!rev.diffopt.output_format ||
+ rev.diffopt.output_format == DIFF_FORMAT_PATCH)
rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_PATCH;
if (!DIFF_OPT_TST(&rev.diffopt, TEXT) && !no_binary_diff)