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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  void log_write_email_headers(struct rev_info *opt, struct commit *commit,
>  			     const char **extra_headers_p,
>  			     int *need_8bit_cte_p,
> @@ -647,10 +655,12 @@ static void next_commentary_block(struct rev_info *opt, struct strbuf *sb)
>  void show_log(struct rev_info *opt)
>  {
>  	struct strbuf msgbuf = STRBUF_INIT;
> +	struct strbuf hdrbuf = STRBUF_INIT;
>  	struct log_info *log = opt->loginfo;
>  	struct commit *commit = log->commit, *parent = log->parent;
>  	int abbrev_commit = opt->abbrev_commit ? opt->abbrev : the_hash_algo->hexsz;
>  	const char *extra_headers = opt->extra_headers;
> +	char *to_free;
>  	struct pretty_print_context ctx = {0};
>  
>  	opt->loginfo = NULL;
> @@ -770,6 +780,11 @@ void show_log(struct rev_info *opt)
>  		ctx.notes_message = strbuf_detach(&notebuf, NULL);
>  	}
>  
> +	format_recipients(opt, &hdrbuf);
> +
> +	if (extra_headers)
> +		strbuf_addstr(&hdrbuf, extra_headers);
> +
>  	/*
>  	 * And then the pretty-printed message itself
>  	 */
> @@ -779,7 +794,7 @@ void show_log(struct rev_info *opt)
>  	ctx.date_mode = opt->date_mode;
>  	ctx.date_mode_explicit = opt->date_mode_explicit;
>  	ctx.abbrev = opt->diffopt.abbrev;
> -	ctx.after_subject = extra_headers;
> +	ctx.after_subject = to_free = strbuf_detach(&hdrbuf, NULL);

Can you explain in the commit message why hdrbuf, which contains the
output from format_recipients and extra_headers, is still the same
functionality as before?

> -void recipients_to_header_buf(const char *hdr, struct strbuf *buf,
> -			      const struct string_list *recipients);
> +void format_recipients(struct rev_info *rev, struct strbuf *sb);

What do you think about renaming this function to strbuf_add_recipients
and swapping the parameters? 



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux