summaryrefslogtreecommitdiff
path: root/ui-log.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-log.c')
-rw-r--r--ui-log.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/ui-log.c b/ui-log.c
index 9f5fdf6..a41d2b2 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -8,12 +8,18 @@
#include "cgit.h"
-int files, lines;
+int files, add_lines, rem_lines;
void count_lines(char *line, int size)
{
- if (size>0 && (line[0] == '+' || line[0] == '-'))
- lines++;
+ if (size <= 0)
+ return;
+
+ if (line[0] == '+')
+ add_lines++;
+
+ else if (line[0] == '-')
+ rem_lines++;
}
void inspect_files(struct diff_filepair *pair)
@@ -35,13 +41,14 @@ void print_commit(struct commit *commit)
sha1_to_hex(commit->object.sha1));
if (cgit_repo->enable_log_filecount) {
files = 0;
- lines = 0;
+ add_lines = 0;
+ rem_lines = 0;
cgit_diff_commit(commit, inspect_files);
html("</td><td class='right'>");
htmlf("%d", files);
if (cgit_repo->enable_log_linecount) {
html("</td><td class='right'>");
- htmlf("%d", lines);
+ htmlf("-%d/+%d", rem_lines, add_lines);
}
}
html("</td><td>");
@@ -83,14 +90,14 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
}
prepare_revision_walk(&rev);
- html("<table class='list nowrap'>");
+ html("<table summary='log' class='list nowrap'>");
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>");
+ html("<th class='right'>Files</th>");
if (cgit_repo->enable_log_linecount)
- html("<th class='left'>Lines</th>");
+ html("<th class='right'>Lines</th>");
}
html("<th class='left'>Author</th></tr>\n");
/td>Christophe Fergeau1-5/+8 2012-09-06Add dependencies to README.Jason A. Donenfeld1-0/+8 2012-09-06Change debian name.Jason A. Donenfeld5-5/+4 2012-09-06Use more normal sleep variant.1.1.1Jason A. Donenfeld1-1/+1 2012-09-06Use --noreport instead of head -n -2 for tree so that it works on mac.Jason A. Donenfeld1-1/+1 2012-09-05Be sure to explicitly state that install is a phony target.Jason A. Donenfeld1-0/+2 2012-09-05Bump debian version horribly.1.1Jason A. Donenfeld2-2/+2 2012-09-04No echo mode.Jason A. Donenfeld2-16/+42 2012-09-04Properly quote the path too.Jason A. Donenfeld1-1/+1 2012-09-04Allow passwords having spaces to go unbroken to the clipboard.Bernardo Freitas Paulo da Costa1-1/+1 2012-09-04Separate out the massive git example.Jason A. Donenfeld1-10/+14 2012-09-04Prepare for debianification.1.0Jason A. Donenfeld9-4/+60 2012-09-03Fix readme typo.Jason A. Donenfeld1-1/+1 2012-09-03Show program name properly in error message.Jason A. Donenfeld1-1/+1 2012-09-03Move examples into manpage.Jason A. Donenfeld4-93/+224 2012-09-03Make into a real project.Jason A. Donenfeld8-5/+173 2012-09-03Support pass gitJason A. Donenfeld2-1/+15 2012-08-31Add remove synonyms.Jason A. Donenfeld1-2/+2 2012-08-31Use basename in usage.Jason A. Donenfeld1-2/+1 2012-08-19now using gpg_id as a varMatthew Ramirez1-2/+2 2012-08-07Forty five seconds.Jason A. Donenfeld1-1/+1 2012-08-06Deal with klipper and new lines.Jason A. Donenfeld1-3/+19 2012-08-06Update examples.Jason A. Donenfeld1-7/+7 2012-08-06Update readme.Jason A. Donenfeld1-11/+13 2012-08-06Be slicker and more like git.Jason A. Donenfeld1-114/+173