garbash-stagit

garbash fork of stagit for git hosting with subdirs
git clone git://git.alexkarle.com.com/garbash-stagit
Log | Files | Refs | README | LICENSE

commit 4f318941d086371f4e87f1e7b96f1c029f8766c2 (patch)
parent 200ccad8b566c3705f3d3e5dd7d5456be85e6900
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Tue,  5 Jan 2016 21:04:07 +0100

revert log.html to log/head.html change

Diffstat:
Mstagit-index.c | 2+-
Mstagit.1 | 2+-
Mstagit.c | 9++++++---
3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/stagit-index.c b/stagit-index.c @@ -145,7 +145,7 @@ writelog(FILE *fp) fputs("<tr><td><a href=\"", fp); xmlencode(fp, name, strlen(name)); - fputs("/log/HEAD.html\">", fp); + fputs("/log.html\">", fp); xmlencode(fp, name, strlen(name)); fputs("</a></td><td>", fp); xmlencode(fp, description, strlen(description)); diff --git a/stagit.1 b/stagit.1 @@ -17,7 +17,7 @@ to the current directory. The following files will be written: Atom XML feed .It files.html List of files in the latest HEAD commit, linking to the file. -.It log/HEAD.html +.It log.html List of commits in order of most recent to old of the commits (top to bottom), each commit links to a page with a diff and diffstat of the commit. .It refs.html diff --git a/stagit.c b/stagit.c @@ -263,7 +263,7 @@ writeheader(FILE *fp) fputs("</a></td></tr>", fp); } fputs("<tr><td></td><td>\n", fp); - fprintf(fp, "<a href=\"%slog/HEAD.html\">Log</a> | ", relpath); + fprintf(fp, "<a href=\"%slog.html\">Log</a> | ", relpath); fprintf(fp, "<a href=\"%sfiles.html\">Files</a> | ", relpath); fprintf(fp, "<a href=\"%srefs.html\">Refs/branches</a>", relpath); if (hasreadme) @@ -463,8 +463,10 @@ writelog(FILE *fp, const char *branch) fputs("<table id=\"log\"><thead>\n<tr><td>Age</td><td>Commit message</td>" "<td>Author</td><td>Files</td><td class=\"num\">+</td>" "<td class=\"num\">-</td></tr>\n</thead><tbody>\n", fp); - relpath = "../"; + while (!git_revwalk_next(&id, w)) { + relpath = ""; + if (!(ci = commitinfo_getbyoid(&id))) break; @@ -493,6 +495,7 @@ writelog(FILE *fp, const char *branch) fprintf(fp, "-%zu", ci->delcount); fputs("</td></tr>\n", fp); + relpath = "../"; printshowfile(ci); commitinfo_free(ci); @@ -1019,7 +1022,7 @@ main(int argc, char *argv[]) /* log for HEAD */ mkdir("log", 0755); - fp = efopen("log/HEAD.html", "w"); + fp = efopen("log.html", "w"); relpath = "../"; writeheader(fp); relpath = "";