From 5a36c2a291a00b59b8ec2f112453e117797c2fe5 Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Mon, 15 Nov 2010 18:39:49 +0100 Subject: ui-log: Change display of full commit messages (and notes) When showmsg is enabled, ui-log (in addition to the table row containing the details of the current commit) adds a second table row containing the remainder of the commit message, and yet another table row containing the commit notes (if any). The vertical margins between commit subject, commit message and commit notes are controlled by CSS. In preparation for the commit graph (which will be printed to the left of the commit message/notes) we need to eliminate these vertical margins (as they would produce ugly gaps in the commit graph) and instead achieve them by adding newlines to the commit message/notes. Furthermore, we can no longer print the "Notes:" header in the "Age" column, since the graph will be drawn between the "Age" column and the "Commit message" column. This patch therefore prepares the commit message and commit notes in a single buffer (properly formatting the notes using the NOTES_SHOW_HEADER and NOTES_INDENT flags to format_note()), and then prints the entire buffer into a single table row. Signed-off-by: Johan Herland Signed-off-by: Lars Hjemli --- cgit.css | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'cgit.css') diff --git a/cgit.css b/cgit.css index 0c88b65..7a5f423 100644 --- a/cgit.css +++ b/cgit.css @@ -161,18 +161,7 @@ table.list td.logsubject { table.list td.logmsg { font-family: monospace; white-space: pre; - padding: 1em 0.5em 2em 0.5em; -} - -table.list td.lognotes-label { - text-align:right; - vertical-align:top; -} - -table.list td.lognotes { - font-family: monospace; - white-space: pre; - padding: 0em 0.5em 2em 0.5em; + padding: 0 0.5em; } table.list td a { -- cgit v1.2.3 From 9a8d39c668b98464bac97d4e5442966de63f97b2 Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Mon, 15 Nov 2010 18:39:50 +0100 Subject: ui-log: Implement support for commit graphs Teach CGit to print an ASCII art commit graph to the left of the commit message, similar to 'git log --graph'. The graph adds extra lines (table rows) to the log when needed to add/remove/shuffle edges in the graph. When 'showmsg' is enabled, the graph is automatically padded to account for the extra lines added by the commit message/notes. This feature is controlled by a new config variable: "enable-commit-graph" (disabled by default), and individual repos can control it by setting "repo.enable-commit-graph". Signed-off-by: Johan Herland Signed-off-by: Lars Hjemli --- cgit.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cgit.css') diff --git a/cgit.css b/cgit.css index 7a5f423..7600e84 100644 --- a/cgit.css +++ b/cgit.css @@ -153,6 +153,11 @@ table.list td { padding: 0.1em 0.5em 0.1em 0.5em; } +table.list td.commitgraph { + font-family: monospace; + white-space: pre; +} + table.list td.logsubject { font-family: monospace; font-weight: bold; @@ -731,4 +736,4 @@ table.ssdiff td.space { table.ssdiff td.space div { min-height: 3em; -} \ No newline at end of file +} -- cgit v1.2.3 From 268b34af23cdcac87aed3300bfe6154cbc65753e Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Mon, 15 Nov 2010 18:39:51 +0100 Subject: ui-log: Colorize commit graph Use the existing coloring logic in Git's graph code to color the lines between commits in the commit graph. Whereas Git normally uses ANSI color escapes to produce colors, we here use graph_set_column_colors() to replace those with HTML color escapes, that embed the graph lines in tags that apply the desired color using CSS. Signed-off-by: Johan Herland Signed-off-by: Lars Hjemli --- cgit.css | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'cgit.css') diff --git a/cgit.css b/cgit.css index 7600e84..1ebef55 100644 --- a/cgit.css +++ b/cgit.css @@ -158,6 +158,30 @@ table.list td.commitgraph { white-space: pre; } +table.list td.commitgraph .column1 { + color: #a00; +} + +table.list td.commitgraph .column2 { + color: #0a0; +} + +table.list td.commitgraph .column3 { + color: #aa0; +} + +table.list td.commitgraph .column4 { + color: #00a; +} + +table.list td.commitgraph .column5 { + color: #a0a; +} + +table.list td.commitgraph .column6 { + color: #0aa; +} + table.list td.logsubject { font-family: monospace; font-weight: bold; -- cgit v1.2.3