Re: [PATCH 2/2] pretty: use fmt_output_email_subject()

2017-03-01 Thread Jeff King
On Wed, Mar 01, 2017 at 11:38:57AM -0800, Junio C Hamano wrote: > On Wed, Mar 1, 2017 at 11:32 AM, Jeff King wrote: > > I would think that future callers would just need to provide a dummy > > pp->rev. I guess that logic could be pushed down into > > fmt_output_email_subject(), so

Re: [PATCH 2/2] pretty: use fmt_output_email_subject()

2017-03-01 Thread René Scharfe
Am 01.03.2017 um 12:37 schrieb René Scharfe: Add the email-style subject prefix (e.g. "Subject: [PATCH] ") directly when it's needed instead of letting log_write_email_headers() prepare it in a static buffer in advance. This simplifies storage ownership and code flow. Signed-off-by: Rene

Re: [PATCH 2/2] pretty: use fmt_output_email_subject()

2017-03-01 Thread Junio C Hamano
On Wed, Mar 1, 2017 at 11:32 AM, Jeff King wrote: > I would think that future callers would just need to provide a dummy > pp->rev. I guess that logic could be pushed down into > fmt_output_email_subject(), so that it skips looking at > opt->subject_prefix, etc, when "opt" is NULL,

Re: [PATCH 2/2] pretty: use fmt_output_email_subject()

2017-03-01 Thread Jeff King
On Wed, Mar 01, 2017 at 10:08:10AM -0800, Junio C Hamano wrote: > > strbuf_grow(sb, title.len + 1024); > > - if (pp->subject) { > > - strbuf_addstr(sb, pp->subject); > > + if (pp->print_email_subject) { > > + if (pp->rev) > > +

Re: [PATCH 2/2] pretty: use fmt_output_email_subject()

2017-03-01 Thread Jeff King
On Wed, Mar 01, 2017 at 12:37:07PM +0100, René Scharfe wrote: > Add the email-style subject prefix (e.g. "Subject: [PATCH] ") directly > when it's needed instead of letting log_write_email_headers() prepare > it in a static buffer in advance. This simplifies storage ownership and > code flow.

Re: [PATCH 2/2] pretty: use fmt_output_email_subject()

2017-03-01 Thread Junio C Hamano
René Scharfe writes: > Add the email-style subject prefix (e.g. "Subject: [PATCH] ") directly > when it's needed instead of letting log_write_email_headers() prepare > it in a static buffer in advance. This simplifies storage ownership and > code flow. It certainly does. At

[PATCH 2/2] pretty: use fmt_output_email_subject()

2017-03-01 Thread René Scharfe
Add the email-style subject prefix (e.g. "Subject: [PATCH] ") directly when it's needed instead of letting log_write_email_headers() prepare it in a static buffer in advance. This simplifies storage ownership and code flow. Signed-off-by: Rene Scharfe --- This slows down the last