summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 53645a3)
raw | patch | inline | side by side (parent: 53645a3)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 20 Jan 2007 08:51:41 +0000 (00:51 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 21 Jan 2007 05:32:31 +0000 (21:32 -0800) |
Now, "git log --abbrev-commit --pretty=o --walk-reflogs HEAD" is
reasonably pleasant to use.
Signed-off-by: Junio C Hamano <junkio@cox.net>
reasonably pleasant to use.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-rev-list.txt | patch | blob | history | |
log-tree.c | patch | blob | history | |
reflog-walk.c | patch | blob | history | |
reflog-walk.h | patch | blob | history |
index fcc540bd3ed13c927d940ac0c56f59b421351119..a996f6cb1e4e9e94dbf3ccfb383990267a1cb819 100644 (file)
[ \--pretty | \--header ]
[ \--bisect ]
[ \--merge ]
+ [ \--walk-reflogs ]
<commit>... [ \-- <paths>... ]
DESCRIPTION
taken from the reflog. By default, 'commit@{Nth}' notation is
used in the output. When the starting commit is specified as
'commit@{now}', output also uses 'commit@{timestamp}' notation
-instead.
+instead. Under '\--pretty=oneline', the commit message is
+prefixed with this information on the same line.
--merge::
diff --git a/log-tree.c b/log-tree.c
index f043ad3723eef60f4e3d7a7a95ba19c89d0bcebf..c0fa09632776885f07552001016a67e77ef19187 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
diff_get_color(opt->diffopt.color_diff, DIFF_RESET));
putchar(opt->commit_format == CMIT_FMT_ONELINE ? ' ' : '\n');
if (opt->reflog_info)
- show_reflog_message(opt->reflog_info);
+ show_reflog_message(opt->reflog_info,
+ opt->commit_format == CMIT_FMT_ONELINE);;
}
/*
diff --git a/reflog-walk.c b/reflog-walk.c
index 989a7aee95ae2cd5a71e68920df5ca2f69cfef83..8ccbe97760009745b9bbbb123691dcfb7072c87e 100644 (file)
--- a/reflog-walk.c
+++ b/reflog-walk.c
commit->object.flags &= ~(ADDED | SEEN | SHOWN);
}
-void show_reflog_message(struct reflog_walk_info* info)
+void show_reflog_message(struct reflog_walk_info* info, int oneline)
{
if (info && info->last_commit_reflog) {
struct commit_reflog *commit_reflog = info->last_commit_reflog;
struct reflog_info *info;
- printf("Reflog: %s@{", commit_reflog->reflogs->ref);
- info = &commit_reflog->reflogs->items[commit_reflog->recno + 1];
- if (commit_reflog->flag)
- printf("%s", show_rfc2822_date(info->timestamp,
- info->tz));
- else
- printf("%d", commit_reflog->reflogs->nr
- - 2 - commit_reflog->recno);
- printf("} (%s)\nReflog message: %s",
- info->email, info->message);
+ info = &commit_reflog->reflogs->items[commit_reflog->recno+1];
+ if (oneline) {
+ printf("%s@{", commit_reflog->reflogs->ref);
+ if (commit_reflog->flag)
+ printf("%s", show_date(info->timestamp, 0, 1));
+ else
+ printf("%d", commit_reflog->reflogs->nr
+ - 2 - commit_reflog->recno);
+ printf("}: ");
+ }
+ else {
+ printf("Reflog: %s@{", commit_reflog->reflogs->ref);
+ if (commit_reflog->flag)
+ printf("%s", show_rfc2822_date(info->timestamp,
+ info->tz));
+ else
+ printf("%d", commit_reflog->reflogs->nr
+ - 2 - commit_reflog->recno);
+ printf("} (%s)\nReflog message: %s",
+ info->email, info->message);
+ }
}
}
diff --git a/reflog-walk.h b/reflog-walk.h
index 787996b377b73cb653ac5b46af3bdf9585570d78..e63d86778bbba826c0943598e1130d31a87b4b77 100644 (file)
--- a/reflog-walk.h
+++ b/reflog-walk.h
struct commit *commit, const char *name);
extern void fake_reflog_parent(struct reflog_walk_info *info,
struct commit *commit);
-extern void show_reflog_message(struct reflog_walk_info* info);
+extern void show_reflog_message(struct reflog_walk_info *info, int);
#endif