[PATCH v2 2/4] Add format.coverauto boolean
- From
- Frank Terbeck <ft@bewatermyfriend.org>
- Date
- May 4, 2009, 09:59 UTC
- Message-ID
- <1241431142-8444-3-git-send-email-ft@bewatermyfriend.org>
- In-Reply-To
- <7v8wlxx18c.fsf@gitster.siamese.dyndns.org>
If set to true, format-patch behaves like it had been started using the --cover-letter option.
An exception is if it is called using the --stdout option, which disables format.coverauto, because users of --stdout (like git-rebase.sh) usually are not interested in cover letters at all.
If you do want it anyway, you can use: % git format-patch --stdout --cover-letter
Signed-off-by: Frank Terbeck <ft@bewatermyfriend.org> --- builtin-log.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c index 157c8cf..52c0d47 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -483,6 +483,10 @@ static int git_format_config(const char *var, const char *value, void *cb) if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) { return 0; } + if (!strcmp(var, "format.coverauto")) { + cover_letter = git_config_bool(var, value);; + return 0; + } if (!strcmp(var, "format.coverletter")) { cover_letter_len = git_config_int(var, value); return 0; @@ -789,9 +793,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) * possibly a valid SHA1. */ for (i = 1, j = 1; i < argc; i++) { - if (!strcmp(argv[i], "--stdout")) + if (!strcmp(argv[i], "--stdout")) { use_stdout = 1; - else if (!strcmp(argv[i], "-n") || + cover_letter = 0; + } else if (!strcmp(argv[i], "-n") || !strcmp(argv[i], "--numbered")) numbered = 1; else if (!strcmp(argv[i], "-N") ||
-- 1.6.2.2.446.gfbdc0