From: "Rubén Justo" <rjusto@gmail.com>
To: Git List <git@vger.kernel.org>
Subject: [PATCH] format-patch: assume --cover-letter for diff in multi-patch series
Date: Tue, 4 Jun 2024 00:49:35 +0200 [thread overview]
Message-ID: <6269eed5-f1ff-43f3-9249-d6a0f1852a6c@gmail.com> (raw)
If either `--interdiff` or `--range-diff` is specified without
`--cover-letter`, we'll abort if it would result in a multi-patch series
being generated. Because the cover-letter is needed to give the diff
text in a multi-patch series.
Considering that `format-patch` generates a multi-patch as needed, let's
adopt a similar "cover as necessary" approach when using `--interdiff`
or `--range-diff`.
Signed-off-by: Rubén Justo <rjusto@gmail.com>
---
builtin/log.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index c8ce0c0d88..56101672f8 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -2286,8 +2286,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
rev.total = total + start_number - 1;
if (idiff_prev.nr) {
- if (!cover_letter && total != 1)
- die(_("--interdiff requires --cover-letter or single patch"));
+ if (!cover_letter && total != 1) {
+ warning(_("--interdiff implies --cover-letter for multi-patch series"));
+ cover_letter = 1;
+ }
rev.idiff_oid1 = &idiff_prev.oid[idiff_prev.nr - 1];
rev.idiff_oid2 = get_commit_tree_oid(list[0]);
rev.idiff_title = diff_title(&idiff_title, reroll_count,
@@ -2301,8 +2303,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
die(_("the option '%s' requires '%s'"), "--creation-factor", "--range-diff");
if (rdiff_prev) {
- if (!cover_letter && total != 1)
- die(_("--range-diff requires --cover-letter or single patch"));
+ if (!cover_letter && total != 1) {
+ warning(_("--range-diff implies --cover-letter for multi-patch series"));
+ cover_letter = 1;
+ }
infer_range_diff_ranges(&rdiff1, &rdiff2, rdiff_prev,
origin, list[0]);
--
2.45.2.405.gf8e6085128
next reply other threads:[~2024-06-03 22:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-03 22:49 Rubén Justo [this message]
2024-06-04 8:02 ` [PATCH] format-patch: assume --cover-letter for diff in multi-patch series Patrick Steinhardt
2024-06-04 17:32 ` Junio C Hamano
2024-06-05 18:01 ` Rubén Justo
2024-06-05 18:17 ` Junio C Hamano
2024-06-05 18:58 ` Junio C Hamano
2024-06-05 20:27 ` [PATCH v3] " Rubén Justo
2024-06-05 20:44 ` Junio C Hamano
2024-06-05 21:24 ` Rubén Justo
2024-06-05 21:52 ` Junio C Hamano
2024-06-05 21:39 ` Rubén Justo
2024-06-07 16:29 ` [PATCH v4 0/2] " Rubén Justo
2024-06-07 16:30 ` [PATCH v4 1/2] t4014: cleanups in a few tests Rubén Justo
2024-06-07 17:14 ` Junio C Hamano
2024-06-07 17:38 ` Rubén Justo
2024-06-07 18:57 ` Junio C Hamano
2024-06-07 16:30 ` [PATCH v4 2/2] format-patch: assume --cover-letter for diff in multi-patch series Rubén Justo
2024-06-07 20:52 ` [PATCH v5 0/2] " Rubén Justo
2024-06-07 20:55 ` [PATCH v5 1/2] t4014: cleanups in a few tests Rubén Justo
2024-06-07 20:55 ` [PATCH v5 2/2] format-patch: assume --cover-letter for diff in multi-patch series Rubén Justo
2024-06-07 21:10 ` [PATCH v5 0/2] " Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6269eed5-f1ff-43f3-9249-d6a0f1852a6c@gmail.com \
--to=rjusto@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).