From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: Git Mailing List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 1/3] pretty: factor out skip_empty_lines()
Date: Sat, 27 Dec 2008 01:32:49 +0100 [thread overview]
Message-ID: <1230337969.8363.84.camel@ubuntu.ubuntu-domain> (raw)
The patch after the next one will use it.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
pretty.c | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/pretty.c b/pretty.c
index f6ff312..c43497b 100644
--- a/pretty.c
+++ b/pretty.c
@@ -181,6 +181,20 @@ static int is_empty_line(const char *line, int *len_p)
return !len;
}
+static const char *skip_empty_lines(const char *msg)
+{
+ for (;;) {
+ int linelen = get_one_line(msg);
+ int ll = linelen;
+ if (!linelen)
+ break;
+ if (!is_empty_line(msg, &ll))
+ break;
+ msg += linelen;
+ }
+ return msg;
+}
+
static void add_merge_info(enum cmit_fmt fmt, struct strbuf *sb,
const struct commit *commit, int abbrev)
{
@@ -850,15 +864,7 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,
}
/* Skip excess blank lines at the beginning of body, if any... */
- for (;;) {
- int linelen = get_one_line(msg);
- int ll = linelen;
- if (!linelen)
- break;
- if (!is_empty_line(msg, &ll))
- break;
- msg += linelen;
- }
+ msg = skip_empty_lines(msg);
/* These formats treat the title line specially. */
if (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_EMAIL)
--
1.6.1
next reply other threads:[~2008-12-27 0:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-27 0:32 René Scharfe [this message]
2008-12-27 0:39 ` [PATCH 2/3] pretty: factor out format_subject() René Scharfe
2008-12-27 0:49 ` [PATCH 3/3] pretty: support multiline subjects with format: René Scharfe
2008-12-27 23:24 ` Markus Heidelberg
2008-12-28 0:12 ` René Scharfe
2008-12-28 14:16 ` Markus Heidelberg
2008-12-29 22:15 ` René Scharfe
2009-01-04 10:01 ` Junio C Hamano
2009-01-06 20:41 ` [PATCH 4/3] shortlog: handle multi-line subjects like log --pretty=oneline et. al. do René Scharfe
2009-01-07 21:19 ` Junio C Hamano
2008-12-28 0:13 ` [PATCH 3/3] pretty: support multiline subjects with format: Junio C Hamano
2008-12-28 14:26 ` Markus Heidelberg
2008-12-28 0:09 ` Nanako Shiraishi
2008-12-28 1:44 ` Miklos Vajna
2008-12-28 14:08 ` Markus Heidelberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1230337969.8363.84.camel@ubuntu.ubuntu-domain \
--to=rene.scharfe@lsrfire.ath.cx \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).