Re: [PATCH 2/2] pretty: use fmt_output_email_subject()
- From
Jeff King <peff@peff.net>
- Date
- Mar 1, 2017, 19:43 UTC
- Message-ID
- <20170301194340.5phhr7lqdqiji277@sigill.intra.peff.net>
- In-Reply-To
- <CAPc5daUyu_=5GeGqBAG_KvkZFE_0oD6Wa_HhoRQwZ2ANUwOF+Q@mail.gmail.com>
On Wed, Mar 01, 2017 at 11:38:57AM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> On Wed, Mar 1, 2017 at 11:32 AM, Jeff King <peff@peff.net> 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, and just hits the > > "Subject:" case arm. > > The "flexibility" I was wondering about is that the current .subject can > point at any caller-supplied string, not "Subject:".
Ah, I see. I don't think that is a huge loss, as nobody was using it. And "Subject:" is already hard-coded in the nr/total counting bits, which are what you'd want to reuse. I think it is fine to punt to the future. If somebody really wants it later, the right fix is for them to provide a string that fmt_output_email_subject() would use in place of "Subject:" when it adds to the strbuf.
-Peff