All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Zev Weiss <zev@bewilderbeest.net>
Cc: git@vger.kernel.org,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"René Scharfe" <l.s.r@web.de>,
	"Denton Liu" <liu.denton@gmail.com>,
	"Emma Brooks" <me@pluvano.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Patrick Hemmer" <git@stormcloud9.net>
Subject: Re: [PATCH 3/5] log: Push to/cc handling down into show_log()
Date: Thu, 19 Jan 2023 16:33:34 -0800	[thread overview]
Message-ID: <xmqqy1pyyrhd.fsf@gitster.g> (raw)
In-Reply-To: <20230119223858.29262-4-zev@bewilderbeest.net> (Zev Weiss's message of "Thu, 19 Jan 2023 14:38:56 -0800")

Zev Weiss <zev@bewilderbeest.net> writes:

> Subject: Re: [PATCH 3/5] log: Push to/cc handling down into show_log()

s/Push/push/
cf. Documentation/SubmittingPatches[[summary-section]]

This is common to all these patches.

> @@ -1326,6 +1326,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
>  	pp.rev = rev;
>  	pp.print_email_subject = 1;
>  	pp_user_info(&pp, NULL, &sb, committer, encoding);
> +	format_recipients(rev, &sb);

This is where the two new members in the rev structure is used.

> @@ -2028,9 +2029,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
>  		strbuf_addch(&buf, '\n');
>  	}
>  
> -	recipients_to_header_buf("To", &buf, &extra_to);
> -	recipients_to_header_buf("Cc", &buf, &extra_cc);
> -
> +	rev.to_recipients = &extra_to;
> +	rev.cc_recipients = &extra_cc;
>  	rev.extra_headers = to_free = strbuf_detach(&buf, NULL);

And these two members point at borrowed memory.  extra_to and
extra_cc is freed after everything is done, near the end of the
cmd_format_patch() function.  We don't leak any extra memory by this
change, which is good.

  reply	other threads:[~2023-01-20  0:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 22:38 [PATCH 0/5] format-patch: Add --{to,cc}-cmd support Zev Weiss
2023-01-19 22:38 ` [PATCH 1/5] t4014: Add test checking cover-letter To header Zev Weiss
2023-02-01 23:52   ` Calvin Wan
2023-01-19 22:38 ` [PATCH 2/5] log: Refactor duplicated code to headerize recipient lists Zev Weiss
2023-01-25  2:11   ` Junio C Hamano
2023-01-19 22:38 ` [PATCH 3/5] log: Push to/cc handling down into show_log() Zev Weiss
2023-01-20  0:33   ` Junio C Hamano [this message]
2023-02-01 23:52   ` Calvin Wan
2023-01-19 22:38 ` [PATCH 4/5] pretty: Add name_and_address_only parameter Zev Weiss
2023-01-25  2:23   ` Junio C Hamano
2023-02-01 23:52   ` Calvin Wan
2023-01-19 22:38 ` [PATCH 5/5] format-patch: Add support for --{to,cc}-cmd flags Zev Weiss
2023-02-01 23:52   ` Calvin Wan
2023-02-01 23:52 ` [PATCH 0/5] format-patch: Add --{to,cc}-cmd support Calvin Wan

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=xmqqy1pyyrhd.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@stormcloud9.net \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    --cc=liu.denton@gmail.com \
    --cc=me@pluvano.com \
    --cc=sandals@crustytoothpaste.net \
    --cc=sunshine@sunshineco.com \
    --cc=zev@bewilderbeest.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.