From: Lars Hjemli Date: Thu, 2 Jun 2011 10:33:23 +0000 (+0000) Subject: Merge branch 'stable' X-Git-Url: https://gitweb.ps.run/ps-cgit/commitdiff_plain/7eb9f9e980c2ce1d93c979c4725cf7b60083b7b4?hp=-c Merge branch 'stable' --- 7eb9f9e980c2ce1d93c979c4725cf7b60083b7b4 diff --combined ui-log.c index 2e6e9d6,15ed6a3..4a295bd --- a/ui-log.c +++ b/ui-log.c @@@ -95,15 -95,15 +95,14 @@@ void show_commit_decorations(struct com void print_commit(struct commit *commit, struct rev_info *revs) { struct commitinfo *info; - char *tmp; int cols = revs->graph ? 3 : 2; struct strbuf graphbuf = STRBUF_INIT; struct strbuf msgbuf = STRBUF_INIT; - if (ctx.repo->enable_log_filecount) { + if (ctx.repo->enable_log_filecount) + cols++; + if (ctx.repo->enable_log_linecount) cols++; - if (ctx.repo->enable_log_linecount) - cols++; - } if (revs->graph) { /* Advance graph until current commit */ @@@ -129,11 -129,7 +128,7 @@@ } else { html(""); - 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(); html(""); } @@@ -171,25 -167,21 +166,21 @@@ if (revs->graph) { html(""); - 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) { + if (ctx.repo->enable_log_filecount || ctx.repo->enable_log_linecount) { files = 0; add_lines = 0; rem_lines = 0; cgit_diff_commit(commit, inspect_files, ctx.qry.vpath); - html(""); - htmlf("%d", files); - if (ctx.repo->enable_log_linecount) { - html(""); - htmlf("-%d/+%d", rem_lines, add_lines); - } } + + if (ctx.repo->enable_log_filecount) + htmlf("%d", files); + if (ctx.repo->enable_log_linecount) + htmlf("-%d/+%d", rem_lines, add_lines); + html("\n"); if (revs->graph || ctx.qry.showmsg) { /* Print a second table row */ @@@ -378,10 -370,10 +369,10 @@@ void cgit_print_log(const char *tip, in if (ctx.repo->enable_log_filecount) { html("Files"); columns++; - if (ctx.repo->enable_log_linecount) { - html("Lines"); - columns++; - } + } + if (ctx.repo->enable_log_linecount) { + html("Lines"); + columns++; } html("\n"); diff --combined ui-snapshot.c index 067082c,07cc944..126779d --- a/ui-snapshot.c +++ b/ui-snapshot.c @@@ -19,7 -19,7 +19,7 @@@ static int write_compressed_tar_archive f.argv = malloc(2 * sizeof(char *)); f.argv[0] = f.cmd; f.argv[1] = NULL; - cgit_open_filter(&f); + cgit_open_filter(&f, NULL); rv = write_tar_archive(args); cgit_close_filter(&f); return rv; @@@ -119,13 -119,11 +119,11 @@@ static const char *get_ref_from_filenam snapshot = xstrdup(filename); snapshot[strlen(snapshot) - strlen(format->suffix)] = '\0'; - fprintf(stderr, "snapshot=%s\n", snapshot); if (get_sha1(snapshot, sha1) == 0) return snapshot; reponame = cgit_repobasename(url); - fprintf(stderr, "reponame=%s\n", reponame); if (prefixcmp(snapshot, reponame) == 0) { snapshot += strlen(reponame); while (snapshot && (*snapshot == '-' || *snapshot == '_'))