format-patch: make "-p" suppress diffstat
commit1d46f2ea143534e46e6bfee3f34cd90b734bfe80
authorJeff King <peff@peff.net>
Wed, 4 Nov 2009 07:19:40 +0000 (4 02:19 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Nov 2009 01:01:36 +0000 (8 17:01 -0800)
treeeae8ece6e65ceb4ebb8880f7227f7e4cbe132a6e
parent78d553b7d7b269bb22ebd8b1198657c37484a3a0
format-patch: make "-p" suppress diffstat

Once upon a time, format-patch would use its default stat
plus patch format only when no diff format was given on the
command line. This meant that "format-patch -p" would
suppress the stat and show just the patch.

Commit 68daa64 changed this to keep the stat format when we
had an "implicit" patch format, like "-U5". As a side
effect, this meant that an explicit patch format was now
ignored (because cmd_format_patch didn't know the reason
that the format was set way down in diff_opt_parse).

This patch unbreaks what 68daa64 did (while still preserving
what 68daa64 was trying to do), reinstating "-p" to suppress
the default behavior. We do this by parsing "-p" ourselves
in format-patch, and noting whether it was used explicitly.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-log.c
t/t4014-format-patch.sh