summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--ui-log.c8
-rw-r--r--ui-summary.c8
2 files changed, 6 insertions, 10 deletions
diff --git a/ui-log.c b/ui-log.c
index 4237921..c80fd73 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -16,33 +16,29 @@ void count_lines(char *line, int size)
lines++;
}
void inspect_files(struct diff_filepair *pair)
{
files++;
if (cgit_repo->enable_log_linecount)
cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines);
}
void print_commit(struct commit *commit)
{
- char buf[32];
struct commitinfo *info;
- struct tm *time;
info = cgit_parse_commit(commit);
- time = gmtime(&commit->date);
html("<tr><td>");
- strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M", time);
- html_txt(buf);
+ cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
html("</td><td>");
char *qry = fmt("h=%s", sha1_to_hex(commit->object.sha1));
char *url = cgit_pageurl(cgit_query_repo, "commit", qry);
html_link_open(url, NULL, NULL);
html_ntxt(cgit_max_msg_len, info->subject);
html_link_close();
if (cgit_repo->enable_log_filecount) {
files = 0;
lines = 0;
cgit_diff_commit(commit, inspect_files);
html("</td><td class='right'>");
htmlf("%d", files);
@@ -76,25 +72,25 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path)
rev.abbrev = DEFAULT_ABBREV;
rev.commit_format = CMIT_FMT_DEFAULT;
rev.verbose_header = 1;
rev.show_root_diff = 0;
setup_revisions(argc, argv, &rev, NULL);
if (rev.grep_filter) {
rev.grep_filter->regflags |= REG_ICASE;
compile_grep_patterns(rev.grep_filter);
}
prepare_revision_walk(&rev);
html("<table class='list nowrap'>");
- html("<tr class='nohover'><th class='left'>Date</th>"
+ html("<tr class='nohover'><th class='left'>Age</th>"
"<th class='left'>Message</th>");
if (cgit_repo->enable_log_filecount) {
html("<th class='left'>Files</th>");
if (cgit_repo->enable_log_linecount)
html("<th class='left'>Lines</th>");
}
html("<th class='left'>Author</th></tr>\n");
if (ofs<0)
ofs = 0;
diff --git a/ui-summary.c b/ui-summary.c
index 20394de..5799773 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -19,25 +19,25 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1,
strncpy(buf, refname, sizeof(buf));
commit = lookup_commit(sha1);
if (commit && !parse_commit(commit)){
info = cgit_parse_commit(commit);
html("<tr><td>");
url = cgit_pageurl(cgit_query_repo, "log",
fmt("h=%s", refname));
html_link_open(url, NULL, NULL);
html_txt(buf);
html_link_close();
html("</td><td>");
- cgit_print_date(commit->date, FMT_LONGDATE);
+ cgit_print_age(commit->date, -1, NULL);
html("</td><td>");
html_txt(info->author);
html("</td><td>");
url = cgit_pageurl(cgit_query_repo, "commit",
fmt("h=%s", sha1_to_hex(sha1)));
html_link_open(url, NULL, NULL);
html_ntxt(cgit_max_msg_len, info->subject);
html_link_close();
html("</td></tr>\n");
cgit_free_commitinfo(info);
} else {
html("<tr><td>");
@@ -67,25 +67,25 @@ static void cgit_print_object_ref(struct object *obj)
url = cgit_pageurl(cgit_query_repo, page,
fmt("%s=%s", arg, sha1_to_hex(obj->sha1)));
html_link_open(url, NULL, NULL);
htmlf("%s %s", typename(obj->type),
sha1_to_hex(obj->sha1));
html_link_close();
}
static void print_tag_header()
{
html("<tr class='nohover'><th class='left'>Tag</th>"
- "<th class='left'>Created</th>"
+ "<th class='left'>Age</th>"
"<th class='left'>Author</th>"
"<th class='left'>Reference</th></tr>\n");
header = 1;
}
static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1,
int flags, void *cb_data)
{
struct tag *tag;
struct taginfo *info;
struct object *obj;
char buf[256], *url;
@@ -99,25 +99,25 @@ static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1,
if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag)))
return 2;
if (!header)
print_tag_header();
html("<tr><td>");
url = cgit_pageurl(cgit_query_repo, "view",
fmt("id=%s", sha1_to_hex(sha1)));
html_link_open(url, NULL, NULL);
html_txt(buf);
html_link_close();
html("</td><td>");
if (info->tagger_date > 0)
- cgit_print_date(info->tagger_date, FMT_LONGDATE);
+ cgit_print_age(info->tagger_date, -1, NULL);
html("</td><td>");
if (info->tagger)
html(info->tagger);
html("</td><td>");
cgit_print_object_ref(tag->tagged);
html("</td></tr>\n");
} else {
if (!header)
print_tag_header();
html("<tr><td>");
html_txt(buf);
html("</td><td colspan='2'/><td>");
@@ -162,25 +162,25 @@ static int cgit_print_archive_cb(const char *refname, const unsigned char *sha1,
fmt("id=%s&path=%s", sha1_to_hex(fileid),
buf));
html_link_open(url, NULL, NULL);
html_txt(buf);
html_link_close();
html("</td><tr>");
return 0;
}
static void cgit_print_branches()
{
html("<tr class='nohover'><th class='left'>Branch</th>"
- "<th class='left'>Updated</th>"
+ "<th class='left'>Idle</th>"
"<th class='left'>Author</th>"
"<th class='left'>Head commit</th></tr>\n");
for_each_branch_ref(cgit_print_branch_cb, NULL);
}
static void cgit_print_tags()
{
header = 0;
for_each_tag_ref(cgit_print_tag_cb, NULL);
}
static void cgit_print_archives()