Re: [PATCH 2/5] sequencer: use skip_blank_lines() to find the commit subject
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 29, 2016, 22:03 UTC
- Message-ID
- <xmqqpoqz1wmh.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <69bc831064331117141c7153dc72e9e658691155.1467209576.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 26 quoted lines
> Just like we already taught the find_commit_subject() function (to make
> it consistent with the code in pretty.c), we now simply skip leading
> blank lines of the commit message.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> sequencer.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/sequencer.c b/sequencer.c
> index 7d7add6..cdfac82 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -544,10 +544,8 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
> * information followed by "\n\n".
> */
> p = strstr(msg.message, "\n\n");
> - if (p) {
> - p += 2;
> - strbuf_addstr(&msgbuf, p);
> - }
> + if (p)
> + strbuf_addstr(&msgbuf, skip_blank_lines(p + 2));
>
> if (opts->record_origin) {
> if (!has_conforming_footer(&msgbuf, NULL, 0))Here, msg.message was read in get_message() by calling logmsg_reencode() that reads from get_commit_buffer(). The code structure is exactly the same as the previous one.
Good.