From: Tanay Abhra <tanayabh@gmail.com>
To: git@vger.kernel.org, tanayabh@gmail.com
Subject: [PATCH] commit.c:record_author_date() use skip_prefix() instead of starts_with()
Date: Sat, 1 Mar 2014 11:48:19 -0800 [thread overview]
Message-ID: <1393703299-7977-1-git-send-email-tanayabh@gmail.com> (raw)
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
---
commit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commit.c b/commit.c
index 6bf4fe0..c954ecb 100644
--- a/commit.c
+++ b/commit.c
@@ -566,7 +566,7 @@ static void record_author_date(struct author_date_slab *author_date,
buf;
buf = line_end + 1) {
line_end = strchrnul(buf, '\n');
- if (!starts_with(buf, "author ")) {
+ if (!skip_prefix(buf, "author ")) {
if (!line_end[0] || line_end[1] == '\n')
return; /* end of header */
continue;
--
1.7.9.5
Hello,
This is my patch for the GSoC microproject #10:
Rewrite commit.c:record_author_date() to use skip_prefix().
Are there other places in this file where skip_prefix() would be more
readable than starts_with()?
Since skip_prefix() and starts_with() implement the same functionality with different
return values, they can be interchanged easily.
Other usage of starts_with() in the same file can be found with
$ grep -n starts_with commit.c
1116: else if (starts_with(line, gpg_sig_header) &&
1196: if (starts_with(buf, sigcheck_gpg_status[i].check + 1)) {
I have a query,should I tackle a bug from the mailing lists or research about the proposal
and present a rough draft?
Cheers,
Tanay Abhra.
next reply other threads:[~2014-03-01 19:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-01 19:48 Tanay Abhra [this message]
2014-03-03 8:58 ` [PATCH] commit.c:record_author_date() use skip_prefix() instead of starts_with() Michael Haggerty
2014-03-03 18:40 ` Junio C Hamano
2014-03-03 19:52 ` Eric Sunshine
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=1393703299-7977-1-git-send-email-tanayabh@gmail.com \
--to=tanayabh@gmail.com \
--cc=git@vger.kernel.org \
/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).