]> gitweb.ps.run Git - ps-cgit/commitdiff
Merge branch 'stable'
authorLars Hjemli <hjemli@gmail.com>
Thu, 2 Jun 2011 10:33:23 +0000 (10:33 +0000)
committerLars Hjemli <hjemli@gmail.com>
Thu, 2 Jun 2011 10:33:23 +0000 (10:33 +0000)
1  2 
ui-log.c
ui-snapshot.c

diff --combined ui-log.c
index 2e6e9d66125064c3737954ef7420240c28d26eeb,15ed6a3f63dabea9cad60ae645b1450178dc274e..4a295bd4a484bb86ba3373a07a62f3b2ed4b1d35
+++ 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 */
        }
        else {
                html("<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();
                html("</td>");
        }
  
  
        if (revs->graph) {
                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) {
 +      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("</td><td>");
 -              htmlf("%d", files);
 -              if (ctx.repo->enable_log_linecount) {
 -                      html("</td><td>");
 -                      htmlf("-%d/+%d", rem_lines, add_lines);
 -              }
        }
 +
 +      if (ctx.repo->enable_log_filecount)
 +              htmlf("</td><td>%d", files);
 +      if (ctx.repo->enable_log_linecount)
 +              htmlf("</td><td>-%d/+%d", rem_lines, add_lines);
 +
        html("</td></tr>\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("<th class='left'>Files</th>");
                columns++;
 -              if (ctx.repo->enable_log_linecount) {
 -                      html("<th class='left'>Lines</th>");
 -                      columns++;
 -              }
 +      }
 +      if (ctx.repo->enable_log_linecount) {
 +              html("<th class='left'>Lines</th>");
 +              columns++;
        }
        html("</tr>\n");
  
diff --combined ui-snapshot.c
index 067082c30c225ef445acc8c226881436e2cb736e,07cc944525c53096b5c429f25fd2b29c68eaa28f..126779d18f12098f5cbde679afb57b8807e2056f
@@@ -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 == '_'))