aboutsummaryrefslogtreecommitdiff
path: root/builtin-log.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2009-01-02 19:08:43 +0100
committerJunio C Hamano <gitster@pobox.com>2009-01-05 10:52:28 -0800
commitea718e65fab17297a8a9dbebf63ae99096e9537a (patch)
treea54c6a11023d35817cbf23f4126d474eda1f913a /builtin-log.c
parentdf63fbbf46c5ec855132f4c631c32b45f67b42e4 (diff)
downloadgit-ea718e65fab17297a8a9dbebf63ae99096e9537a.tar.gz
git-ea718e65fab17297a8a9dbebf63ae99096e9537a.tar.xz
show <tag>: reuse pp_user_info() instead of duplicating code
We used to extract the tagger information "by hand" in "git show <tag>", but the function pp_user_info() already does that. Even better: it respects the commit_format and date_format specified by the user. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-log.c')
-rw-r--r--builtin-log.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/builtin-log.c b/builtin-log.c
index 99d1137b0..bc4e1e965 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -249,22 +249,13 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix)
static void show_tagger(char *buf, int len, struct rev_info *rev)
{
- char *email_end, *p;
- unsigned long date;
- int tz;
+ struct strbuf out = STRBUF_INIT;
- email_end = memchr(buf, '>', len);
- if (!email_end)
- return;
- p = ++email_end;
- while (isspace(*p))
- p++;
- date = strtoul(p, &p, 10);
- while (isspace(*p))
- p++;
- tz = (int)strtol(p, NULL, 10);
- printf("Tagger: %.*s\nDate: %s\n", (int)(email_end - buf), buf,
- show_date(date, tz, rev->date_mode));
+ pp_user_info("Tagger", rev->commit_format, &out, buf, rev->date_mode,
+ git_log_output_encoding ?
+ git_log_output_encoding: git_commit_encoding);
+ printf("%s\n", out.buf);
+ strbuf_release(&out);
}
static int show_object(const unsigned char *sha1, int show_tag_object,