Re: [PATCH 3/4] format-patch: new --resend option for adding "RESEND" to patch subjects
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Apr 17, 2024, 06:35 UTC
- Message-ID
- <CAPig+cRzOHROK0VpkLR9fk7Gr0NRH9VKcH4dGXOuoaO5Ky2c2A@mail.gmail.com>
- In-Reply-To
- <1d9c6ce3df714211889453c245485d46b43edff6.1713324598.git.dsimic@manjaro.org>
On Tue, Apr 16, 2024 at 11:33 PM Dragan Simic <dsimic@manjaro.org> wrote:
Show 19 quoted lines
> Add --resend as the new command-line option for "git format-patch" that adds
> "RESEND" as a (sub)suffix to the patch subject prefix, eventually producing
> "[PATCH RESEND]" as the default patch subject prefix.
>
> "[PATCH RESEND]" is a patch subject prefix commonly used on mailing lists
> for patches resent to a mailing list after they had attracted no attention
> for some time, usually for a couple of weeks. As such, this subject prefix
> deserves adding --resend as a new shorthand option to "git format-patch".
>
> Of course, add the description of the new --resend command-line option to
> the documentation for "git format-patch".
>
> Signed-off-by: Dragan Simic <dsimic@manjaro.org>
> ---
> diff --git a/builtin/log.c b/builtin/log.c
> @@ -2111,7 +2116,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
> if (keep_subject && subject_prefix)
> - die(_("options '%s' and '%s' cannot be used together"), "--subject-prefix/--rfc", "-k");
> + die(_("options '%s' and '%s' cannot be used together"), "--subject-prefix/--rfc/--resend", "-k");You probably want to be using die_for_incompatible_opt4() from parse-options.h here.
(And you may want a preparatory patch which fixes the preimage to use die_for_incompatible_opt3() for --subject-prefix, --rfc, and -k exclusivity, though that may be overkill.)