aboutsummaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-05-06 14:42:08 -0700
committerJunio C Hamano <junkio@cox.net>2006-05-06 14:42:59 -0700
commitc66b6c067e49c5ec80f1254daef79aa1c7f5ffce (patch)
tree48367903de59ddef7aea7c8f20da4e07243e8d44 /log-tree.c
parent8ac80a5701780547404523a84f4b1ae67bfa6823 (diff)
parentbd886fd3ea49b726493255d4adf5d20b31681713 (diff)
downloadgit-c66b6c067e49c5ec80f1254daef79aa1c7f5ffce.tar.gz
git-c66b6c067e49c5ec80f1254daef79aa1c7f5ffce.tar.xz
Merge branch 'master' into js/fmt-patch
* master: (109 commits) t1300-repo-config: two new config parsing tests. Another config file parsing fix. update-index: plug memory leak from prefix_path() checkout-index: plug memory leak from prefix_path() update-index --unresolve: work from a subdirectory. pack-object: squelch eye-candy on non-tty core.prefersymlinkrefs: use symlinks for .git/HEAD repo-config: trim white-space before comment Fix for config file section parsing. Clarify git-cherry documentation. Update git-unpack-objects documentation. Fix up docs where "--" isn't displayed correctly. Several trivial documentation touch ups. git-svn 1.0.0 git-svn: documentation updates delta: stricter constness Makefile: do not link rev-list any specially. builtin-push: --all and --tags _are_ explicit refspecs builtin-log/whatchanged/show: make them official. show-branch: omit uninteresting merges. ...
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/log-tree.c b/log-tree.c
index 4a3cd6791..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;
}
@@ -57,6 +69,8 @@ void show_log(struct rev_info *opt, struct log_info *log, const char *sep)
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,