X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=log-tree.c;h=526d578e98eef5a099be43bf39a300b33ac1991c;hb=8a24f2fae0a08d5832318b62cb279fd02f1bdf5a;hp=1ca529d9fefed0d3284c26f5c1503c35ef250779;hpb=596524b33d50e47e2375cec9e00aff59f0e8278b;p=git.git diff --git a/log-tree.c b/log-tree.c index 1ca529d9f..526d578e9 100644 --- a/log-tree.c +++ b/log-tree.c @@ -3,6 +3,15 @@ #include "commit.h" #include "log-tree.h" +static void show_parents(struct commit *commit, int abbrev) +{ + struct commit_list *p; + for (p = commit->parents; p ; p = p->next) { + struct commit *parent = p->item; + printf(" %s", diff_unique_abbrev(parent->object.sha1, abbrev)); + } +} + void show_log(struct rev_info *opt, struct log_info *log, const char *sep) { static char this_header[16384]; @@ -15,7 +24,10 @@ void show_log(struct rev_info *opt, struct log_info *log, const char *sep) opt->loginfo = NULL; if (!opt->verbose_header) { - puts(sha1_to_hex(commit->object.sha1)); + fputs(diff_unique_abbrev(commit->object.sha1, abbrev_commit), stdout); + if (opt->parents) + show_parents(commit, abbrev_commit); + putchar('\n'); return; } @@ -46,14 +58,19 @@ void show_log(struct rev_info *opt, struct log_info *log, const char *sep) "Subject: [PATCH %d/%d] ", opt->nr, opt->total); subject = buffer; - } else + } else if (opt->total == 0) subject = "Subject: [PATCH] "; + else + subject = "Subject: "; + printf("From %s Thu Apr 7 15:13:13 2005\n", sha1_to_hex(commit->object.sha1)); } else { printf("%s%s", opt->commit_format == CMIT_FMT_ONELINE ? "" : "commit ", diff_unique_abbrev(commit->object.sha1, abbrev_commit)); + if (opt->parents) + show_parents(commit, abbrev_commit); if (parent) printf(" (from %s)", diff_unique_abbrev(parent->object.sha1,