Commit ea718e65 authored by Johannes Schindelin's avatar Johannes Schindelin Committed by Junio C Hamano

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's avatarJohannes Schindelin <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent df63fbbf
...@@ -249,22 +249,13 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix) ...@@ -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) static void show_tagger(char *buf, int len, struct rev_info *rev)
{ {
char *email_end, *p; struct strbuf out = STRBUF_INIT;
unsigned long date;
int tz;
email_end = memchr(buf, '>', len); pp_user_info("Tagger", rev->commit_format, &out, buf, rev->date_mode,
if (!email_end) git_log_output_encoding ?
return; git_log_output_encoding: git_commit_encoding);
p = ++email_end; printf("%s\n", out.buf);
while (isspace(*p)) strbuf_release(&out);
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));
} }
static int show_object(const unsigned char *sha1, int show_tag_object, static int show_object(const unsigned char *sha1, int show_tag_object,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment