diff options
author | Taylor Blau <me@ttaylorr.com> | 2022-11-18 20:04:58 -0500 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2022-11-18 20:04:58 -0500 |
commit | c6bb019724237deb91ba4a9185fd04507aadeb6a (patch) | |
tree | 885f749a84017a4c993188af19b76afcaf0304fc /builtin/log.c | |
parent | 01e19872862cd2235c14c6bb348fbeb170abbab7 (diff) | |
parent | 99d0b829c7b376b1ff562a5782e24df47747bb65 (diff) | |
download | git-jch.tar.gz |
Merge branch 'ew/format-patch-mboxrd' into jchjch
Teach `format-patch` a convenient alias for `--pretty=mboxrd`.
* ew/format-patch-mboxrd:
format-patch: add --mboxrd alias for --pretty=mboxrd
Diffstat (limited to 'builtin/log.c')
-rw-r--r-- | builtin/log.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/log.c b/builtin/log.c index 5eafcf26b4..13f5deb7a5 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1872,6 +1872,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) struct strbuf rdiff2 = STRBUF_INIT; struct strbuf rdiff_title = STRBUF_INIT; int creation_factor = -1; + int mboxrd = 0; const struct option builtin_format_patch_options[] = { OPT_CALLBACK_F('n', "numbered", &numbered, NULL, @@ -1883,6 +1884,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) OPT_BOOL('s', "signoff", &do_signoff, N_("add a Signed-off-by trailer")), OPT_BOOL(0, "stdout", &use_stdout, N_("print patches to standard out")), + OPT_BOOL(0, "mboxrd", &mboxrd, + N_("use the robust mboxrd format with --stdout")), OPT_BOOL(0, "cover-letter", &cover_letter, N_("generate a cover letter")), OPT_BOOL(0, "numbered-files", &just_numbers, @@ -2106,6 +2109,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) rev.diffopt.close_file, "--output", !!output_directory, "--output-directory"); + /* should we warn on --mboxrd w/o --stdout? */ + if (mboxrd) + rev.commit_format = CMIT_FMT_MBOXRD; + if (use_stdout) { setup_pager(); } else if (!rev.diffopt.close_file) { |