From: Johan Herland <johan@herland.net>
To: Lars Hjemli <hjemli@gmail.com>
Cc: git@vger.kernel.org, johan@herland.net
Subject: [CGit RFC/PATCH 2/5] ui-log: Move 'Age' column to the right of 'Author', like in gitk
Date: Tue, 13 Jul 2010 23:40:18 +0200 [thread overview]
Message-ID: <1279057221-28036-3-git-send-email-johan@herland.net> (raw)
In-Reply-To: <1279056219-27096-1-git-send-email-johan@herland.net>
This is in preparation for putting the commit graph to the left of the
commit message. IMHO, it looks better when the commit message is right
next to the graph, than if the age is wedged in between.
Signed-off-by: Johan Herland <johan@herland.net>
---
ui-log.c | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/ui-log.c b/ui-log.c
index 33ec8a9..390c38b 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -79,23 +79,22 @@ void print_commit(struct commit *commit)
{
struct commitinfo *info;
char *tmp;
- int cols = 2;
+ int cols = 3;
info = cgit_parse_commit(commit);
- htmlf("<tr%s><td>",
- ctx.qry.showmsg ? " class='logheader'" : "");
- tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1));
- tmp = cgit_fileurl(ctx.repo->url, "commit", ctx.qry.vpath, tmp);
- html_link_open(tmp, NULL, NULL);
- cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
- html_link_close();
- htmlf("</td><td%s>",
- ctx.qry.showmsg ? " class='logsubject'" : "");
+ htmlf("<tr%s>", ctx.qry.showmsg ? " class='logheader'" : "");
+ htmlf("<td%s>", ctx.qry.showmsg ? " class='logsubject'" : "");
cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
sha1_to_hex(commit->object.sha1), ctx.qry.vpath, 0);
show_commit_decorations(commit);
html("</td><td>");
html_txt(info->author);
+ html("</td><td>");
+ tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1));
+ tmp = cgit_fileurl(ctx.repo->url, "commit", ctx.qry.vpath, tmp);
+ html_link_open(tmp, NULL, NULL);
+ cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
+ html_link_close();
if (ctx.repo->enable_log_filecount) {
files = 0;
add_lines = 0;
@@ -115,7 +114,7 @@ void print_commit(struct commit *commit)
if (ctx.repo->enable_log_linecount)
cols++;
}
- htmlf("<tr class='nohover'><td/><td colspan='%d' class='logmsg'>",
+ htmlf("<tr class='nohover'><td colspan='%d' class='logmsg'>",
cols);
html_txt(info->msg);
html("</td></tr>\n");
@@ -176,8 +175,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
if (pager)
html("<table class='list nowrap'>");
- html("<tr class='nohover'><th class='left'>Age</th>"
- "<th class='left'>Commit message");
+ html("<tr class='nohover'><th class='left'>Commit message");
if (pager) {
html(" (");
cgit_log_link(ctx.qry.showmsg ? "Collapse" : "Expand", NULL,
@@ -186,7 +184,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
ctx.qry.search, ctx.qry.showmsg ? 0 : 1);
html(")");
}
- html("</th><th class='left'>Author</th>");
+ html("</th><th class='left'>Author</th><th class='left'>Age</th>");
if (ctx.repo->enable_log_filecount) {
html("<th class='left'>Files</th>");
columns++;
--
1.7.0.4
next prev parent reply other threads:[~2010-07-13 21:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-13 21:23 [PATCH 0/2] Preparing the graph API for external users Johan Herland
2010-07-13 21:23 ` [PATCH 1/2] Make graph_next_line() available in the graph.h API Johan Herland
2010-07-13 21:23 ` [PATCH 2/2] Enable custom schemes for column colors in the graph API Johan Herland
2010-07-13 21:40 ` [CGit RFC/PATCH 0/5] Commit graph on CGit's 'log' view Johan Herland
2010-07-13 22:57 ` Lars Hjemli
2010-07-14 5:59 ` Johan Herland
2010-07-18 13:26 ` Lars Hjemli
2010-07-13 21:40 ` [CGit RFC/PATCH 1/5] ui-stats: Remove unnecessary #include Johan Herland
2010-07-13 21:40 ` Johan Herland [this message]
2010-07-13 21:40 ` [CGit RFC/PATCH 3/5] ui-log: Refactor display of commit messages Johan Herland
2010-07-13 21:40 ` [CGit RFC/PATCH 4/5] ui-log: Implement support for commit graphs Johan Herland
2010-07-13 21:40 ` [CGit RFC/PATCH 5/5] ui-log: Colorize commit graph Johan Herland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1279057221-28036-3-git-send-email-johan@herland.net \
--to=johan@herland.net \
--cc=git@vger.kernel.org \
--cc=hjemli@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).