summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b4dd485)
raw | patch | inline | side by side (parent: b4dd485)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Thu, 8 Feb 2007 20:58:33 +0000 (21:58 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 9 Feb 2007 00:20:52 +0000 (16:20 -0800) |
If you say "git log -g --relative-date", it is very likely that
you want to see the reflog names in terms of a relative date.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
you want to see the reflog names in terms of a relative date.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
log-tree.c | patch | blob | history | |
reflog-walk.c | patch | blob | history | |
reflog-walk.h | patch | blob | history |
diff --git a/log-tree.c b/log-tree.c
index 85acd66df7506b383db545f61eb330e401239b4e..4e3c7fd6fb1e0665d9be8ac6840ec66a4e3130fb 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
putchar(opt->commit_format == CMIT_FMT_ONELINE ? ' ' : '\n');
if (opt->reflog_info) {
show_reflog_message(opt->reflog_info,
- opt->commit_format == CMIT_FMT_ONELINE);;
+ opt->commit_format == CMIT_FMT_ONELINE,
+ opt->relative_date);
if (opt->commit_format == CMIT_FMT_ONELINE) {
printf("%s", sep);
return;
diff --git a/reflog-walk.c b/reflog-walk.c
index 653ec956f08141b3e15f52665cef7a260f8ed6a4..afe1577d76ebd06e323d478f616c838142fa02d0 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, int oneline)
+void show_reflog_message(struct reflog_walk_info* info, int oneline,
+ int relative_date)
{
if (info && info->last_commit_reflog) {
struct commit_reflog *commit_reflog = info->last_commit_reflog;
info = &commit_reflog->reflogs->items[commit_reflog->recno+1];
if (oneline) {
printf("%s@{", commit_reflog->reflogs->ref);
- if (commit_reflog->flag)
+ if (commit_reflog->flag || relative_date)
printf("%s", show_date(info->timestamp, 0, 1));
else
printf("%d", commit_reflog->reflogs->nr
}
else {
printf("Reflog: %s@{", commit_reflog->reflogs->ref);
- if (commit_reflog->flag)
- printf("%s", show_rfc2822_date(info->timestamp,
- info->tz));
+ if (commit_reflog->flag || relative_date)
+ printf("%s", show_date(info->timestamp,
+ info->tz,
+ relative_date));
else
printf("%d", commit_reflog->reflogs->nr
- 2 - commit_reflog->recno);
diff --git a/reflog-walk.h b/reflog-walk.h
index e63d86778bbba826c0943598e1130d31a87b4b77..a4f7015d3e77b7f59ac5bf1e01713b8d277bc879 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, int);
+extern void show_reflog_message(struct reflog_walk_info *info, int, int);
#endif