From: "Drew DeVault" <sir@cmpwn.com>
To: "Jeff King" <peff@peff.net>
Cc: <git@vger.kernel.org>
Subject: Re: [PATCH] builtin/log.c: prepend "RFC" on --rfc
Date: Mon, 28 Aug 2023 16:49:10 +0200 [thread overview]
Message-ID: <CV49EUBH6USG.TQMTR5HU2OGD@taiga> (raw)
In-Reply-To: <20230828144215.GA2537587@coredump.intra.peff.net>
On Mon Aug 28, 2023 at 4:42 PM CEST, Jeff King wrote:
> static int rfc_callback(const struct option *opt, const char *arg, int unset)
> {
> + /*
> + * "avoid" leak by holding on to a reference to the memory, since we
> + * need the string for the lifetime of the process anyway
> + */
> + static char *prefix;
> +
> BUG_ON_OPT_NEG(unset);
> BUG_ON_OPT_ARG(arg);
> - return subject_prefix_callback(opt, "RFC PATCH", unset);
> +
> + free(prefix);
> + prefix = xstrfmt("RFC %s", ((struct rev_info *)opt->value)->subject_prefix);
> +
> + return subject_prefix_callback(opt, prefix, unset);
> }
I like this better, thanks!
next prev parent reply other threads:[~2023-08-28 14:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 12:50 [PATCH] builtin/log.c: prepend "RFC" on --rfc Drew DeVault
2023-08-28 14:42 ` Jeff King
2023-08-28 14:49 ` Drew DeVault [this message]
2023-08-28 16:30 ` Phillip Wood
2023-08-28 17:42 ` Jeff King
2023-08-28 18:12 ` Junio C Hamano
2023-08-28 15:31 ` 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=CV49EUBH6USG.TQMTR5HU2OGD@taiga \
--to=sir@cmpwn.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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