Introduction
Introduction Statistics Contact Development Disclaimer Help
tadd titles to pages, summary for commit messages, filename for files - stagit …
git clone git://src.adamsgaard.dk/stagit
Log
Files
Refs
README
LICENSE
---
commit c379d65770d6ce7d5aea885255d2b1f4d05981e3
parent 78c29a1de25a88b92858d785772315a537cd4035
Author: Hiltjo Posthuma <[email protected]>
Date: Tue, 1 Mar 2016 19:14:00 +0100
add titles to pages, summary for commit messages, filename for files
Diffstat:
M stagit.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/stagit.c b/stagit.c
t@@ -235,12 +235,15 @@ printtimeshort(FILE *fp, const git_time *intime)
}
int
-writeheader(FILE *fp)
+writeheader(FILE *fp, const char *title)
{
fputs("<!DOCTYPE html>\n"
"<html dir=\"ltr\" lang=\"en\">\n<head>\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html; charse…
"<meta http-equiv=\"Content-Language\" content=\"en\" />\n<tit…
+ xmlencode(fp, title, strlen(title));
+ if (title[0] && stripped_name[0])
+ fputs(" - ", fp);
xmlencode(fp, stripped_name, strlen(stripped_name));
if (description[0])
fputs(" - ", fp);
t@@ -478,7 +481,7 @@ writelog(FILE *fp, const git_oid *oid)
/* check if file exists if so skip it */
if (access(path, F_OK)) {
fpfile = efopen(path, "w");
- writeheader(fpfile);
+ writeheader(fpfile, ci->summary);
fputs("<pre>", fpfile);
printshowfile(fpfile, ci);
fputs("</pre>\n", fpfile);
t@@ -603,7 +606,7 @@ writeblob(git_object *obj, const char *fpath, const char *…
relpath = tmp;
fp = efopen(fpath, "w");
- writeheader(fp);
+ writeheader(fp, filename);
fputs("<p> ", fp);
xmlencode(fp, filename, strlen(filename));
fprintf(fp, " (%juB)", (uintmax_t)filesize);
t@@ -961,7 +964,7 @@ main(int argc, char *argv[])
/* log for HEAD */
fp = efopen("log.html", "w");
relpath = "";
- writeheader(fp);
+ writeheader(fp, "Log");
mkdir("commit", 0755);
writelog(fp, head);
writefooter(fp);
t@@ -969,14 +972,14 @@ main(int argc, char *argv[])
/* files for HEAD */
fp = efopen("files.html", "w");
- writeheader(fp);
+ writeheader(fp, "Files");
writefiles(fp, head, "HEAD");
writefooter(fp);
fclose(fp);
/* summary page with branches and tags */
fp = efopen("refs.html", "w");
- writeheader(fp);
+ writeheader(fp, "Refs");
writerefs(fp);
writefooter(fp);
fclose(fp);
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.