git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 20, 2023, 00:33 UTC
Message-ID
<xmqqy1pyyrhd.fsf@gitster.g>
In-Reply-To
<20230119223858.29262-4-zev@bewilderbeest.net>
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.
Show 5 quoted lines
> @@ -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.
Show 10 quoted lines
> @@ -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.

Previous: Zev WeissNext: Calvin Wan
Message 3 of 14 in “format-patch: Add --{to,cc}-cmd support”
  1. 0/5 format-patch: Add --{to,cc}-cmd supportZev Weiss, Jan 19, 2023
  2. 3/5 log: Push to/cc handling down into show_log()Zev Weiss, Jan 19, 2023
  3. Junio C HamanoJan 20, 2023
  4. Calvin WanFeb 1, 2023
  5. 2/5 log: Refactor duplicated code to headerize recipient listsZev Weiss, Jan 19, 2023
  6. Junio C HamanoJan 25, 2023
  7. 4/5 pretty: Add name_and_address_only parameterZev Weiss, Jan 19, 2023
  8. Junio C HamanoJan 25, 2023
  9. Calvin WanFeb 1, 2023
  10. 1/5 t4014: Add test checking cover-letter To headerZev Weiss, Jan 19, 2023
  11. Calvin WanFeb 1, 2023
  12. 5/5 format-patch: Add support for --{to,cc}-cmd flagsZev Weiss, Jan 19, 2023
  13. Calvin WanFeb 1, 2023
  14. Calvin WanFeb 1, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.