commit 9c39aa81e1b77b6f6eb1c1433fa8628fab0f2a62
parent b66306d9f4088f73332e735d1168484919a79337
author: nathanael <nathanael@dalliard.ch>
date: Tue, 2 Dec 2025 11:27:21 +0000
s0: add stagit patch
diffstat:
1 file changed, 281 insertions(+), 0 deletions(-)
diff --git a/s0/patches/stagit-20251202-6c9e61a.diff b/s0/patches/stagit-20251202-6c9e61a.diff
@@ -0,0 +1,281 @@
+From 6c9e61a8eb6cf573919b1a0cc3e1c5b617dad423 Mon Sep 17 00:00:00 2001
+From: nathanael <nathanael@dalliard.ch>
+Date: Tue, 2 Dec 2025 12:20:53 +0100
+Subject: [PATCH] apply my changes
+
+---
+ stagit-index.c | 24 +++++++--------
+ stagit.c | 84 +++++++++++++++++++++++++-------------------------
+ 2 files changed, 54 insertions(+), 54 deletions(-)
+
+diff --git a/stagit-index.c b/stagit-index.c
+index 6402296..fb6e764 100644
+--- a/stagit-index.c
++++ b/stagit-index.c
+@@ -12,7 +12,7 @@ static git_repository *repo;
+
+ static const char *relpath = "";
+
+-static char description[255] = "Repositories";
++static char description[255] = "repositories";
+ static char *name = "";
+ static char owner[255];
+
+@@ -95,23 +95,23 @@ printtimeshort(FILE *fp, const git_time *intime)
+ void
+ writeheader(FILE *fp)
+ {
+- fputs("<!DOCTYPE html>\n"
+- "<html>\n<head>\n"
+- "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n"
+- "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n"
++ fputs("<!doctype html>\n"
++ "<html lang=\"en\">\n<head>\n"
++ "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n"
++ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n"
+ "<title>", fp);
+ xmlencode(fp, description, strlen(description));
+- fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"%sfavicon.png\" />\n", relpath);
+- fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
++ fprintf(fp, "</title>\n<link rel=\"icon\" href=\"%sdata:,\">\n", relpath);
++ fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\">\n", relpath);
+ fputs("</head>\n<body>\n", fp);
+- fprintf(fp, "<table>\n<tr><td><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></td>\n"
++ fprintf(fp, "<table>\n<tr><td><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\"></td>\n"
+ "<td><span class=\"desc\">", relpath);
+ xmlencode(fp, description, strlen(description));
+ fputs("</span></td></tr><tr><td></td><td>\n"
+- "</td></tr>\n</table>\n<hr/>\n<div id=\"content\">\n"
++ "</td></tr>\n</table>\n<hr>\n<div id=\"content\">\n"
+ "<table id=\"index\"><thead>\n"
+- "<tr><td><b>Name</b></td><td><b>Description</b></td><td><b>Owner</b></td>"
+- "<td><b>Last commit</b></td></tr>"
++ "<tr><td><b>name</b></td><td><b>description</b></td><td><b>owner</b></td>"
++ "<td><b>last commit</b></td></tr>"
+ "</thead><tbody>\n", fp);
+ }
+
+@@ -151,7 +151,7 @@ writelog(FILE *fp)
+
+ fputs("<tr><td><a href=\"", fp);
+ percentencode(fp, stripped_name, strlen(stripped_name));
+- fputs("/log.html\">", fp);
++ fputs("/\">", fp);
+ xmlencode(fp, stripped_name, strlen(stripped_name));
+ fputs("</a></td><td>", fp);
+ xmlencode(fp, description, strlen(description));
+diff --git a/stagit.c b/stagit.c
+index 03f0c09..418e942 100644
+--- a/stagit.c
++++ b/stagit.c
+@@ -499,10 +499,10 @@ printtimeshort(FILE *fp, const git_time *intime)
+ void
+ writeheader(FILE *fp, const char *title)
+ {
+- fputs("<!DOCTYPE html>\n"
+- "<html>\n<head>\n"
+- "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n"
+- "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n"
++ fputs("<!doctype html>\n"
++ "<html lang=\"en\">\n<head>\n"
++ "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n"
++ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n"
+ "<title>", fp);
+ xmlencode(fp, title, strlen(title));
+ if (title[0] && strippedname[0])
+@@ -511,16 +511,16 @@ writeheader(FILE *fp, const char *title)
+ if (description[0])
+ fputs(" - ", fp);
+ xmlencode(fp, description, strlen(description));
+- fprintf(fp, "</title>\n<link rel=\"icon\" type=\"image/png\" href=\"%sfavicon.png\" />\n", relpath);
++ fprintf(fp, "</title>\n<link rel=\"icon\" href=\"%sfavicon.png\">\n", relpath);
+ fputs("<link rel=\"alternate\" type=\"application/atom+xml\" title=\"", fp);
+ xmlencode(fp, name, strlen(name));
+- fprintf(fp, " Atom Feed\" href=\"%satom.xml\" />\n", relpath);
++ fprintf(fp, " atom feed\" href=\"%satom.xml\">\n", relpath);
+ fputs("<link rel=\"alternate\" type=\"application/atom+xml\" title=\"", fp);
+ xmlencode(fp, name, strlen(name));
+- fprintf(fp, " Atom Feed (tags)\" href=\"%stags.xml\" />\n", relpath);
+- fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\" />\n", relpath);
++ fprintf(fp, " atom feed (tags)\" href=\"%stags.xml\">\n", relpath);
++ fprintf(fp, "<link rel=\"stylesheet\" type=\"text/css\" href=\"%sstyle.css\">\n", relpath);
+ fputs("</head>\n<body>\n<table><tr><td>", fp);
+- fprintf(fp, "<a href=\"../%s\"><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\" /></a>",
++ fprintf(fp, "<a href=\"../%s\"><img src=\"%slogo.png\" alt=\"\" width=\"32\" height=\"32\"></a>",
+ relpath, relpath);
+ fputs("</td><td><h1>", fp);
+ xmlencode(fp, strippedname, strlen(strippedname));
+@@ -528,26 +528,26 @@ writeheader(FILE *fp, const char *title)
+ xmlencode(fp, description, strlen(description));
+ fputs("</span></td></tr>", fp);
+ if (cloneurl[0]) {
+- fputs("<tr class=\"url\"><td></td><td>git clone <a href=\"", fp);
++ fputs("<tr class=\"url\"><td></td><td>got clone <a href=\"", fp);
+ xmlencode(fp, cloneurl, strlen(cloneurl)); /* not percent-encoded */
+ fputs("\">", fp);
+ xmlencode(fp, cloneurl, strlen(cloneurl));
+ fputs("</a></td></tr>", fp);
+ }
+ fputs("<tr><td></td><td>\n", fp);
+- 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</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</a>", relpath);
+ if (submodules)
+- fprintf(fp, " | <a href=\"%sfile/%s.html\">Submodules</a>",
++ fprintf(fp, " | <a href=\"%sfile/%s.html\">submodules</a>",
+ relpath, submodules);
+ if (readme)
+- fprintf(fp, " | <a href=\"%sfile/%s.html\">README</a>",
++ fprintf(fp, " | <a href=\"%sfile/%s.html\">readme</a>",
+ relpath, readme);
+ if (license)
+- fprintf(fp, " | <a href=\"%sfile/%s.html\">LICENSE</a>",
++ fprintf(fp, " | <a href=\"%sfile/%s.html\">license</a>",
+ relpath, license);
+- fputs("</td></tr></table>\n<hr/>\n<div id=\"content\">\n", fp);
++ fputs("</td></tr></table>\n<hr>\n<div id=\"content\">\n", fp);
+ }
+
+ void
+@@ -600,13 +600,13 @@ printcommit(FILE *fp, struct commitinfo *ci)
+ relpath, ci->parentoid, ci->parentoid);
+
+ if (ci->author) {
+- fputs("<b>Author:</b> ", fp);
++ fputs("<b>author:</b> ", fp);
+ xmlencode(fp, ci->author->name, strlen(ci->author->name));
+ fputs(" <<a href=\"mailto:", fp);
+ xmlencode(fp, ci->author->email, strlen(ci->author->email)); /* not percent-encoded */
+ fputs("\">", fp);
+ xmlencode(fp, ci->author->email, strlen(ci->author->email));
+- fputs("</a>>\n<b>Date:</b> ", fp);
++ fputs("</a>>\n<b>date:</b> ", fp);
+ printtime(fp, &(ci->author->when));
+ putc('\n', fp);
+ }
+@@ -637,12 +637,12 @@ printshowfile(FILE *fp, struct commitinfo *ci)
+ ci->ndeltas > 1000 ||
+ ci->addcount > 100000 ||
+ ci->delcount > 100000) {
+- fputs("Diff is too large, output suppressed.\n", fp);
++ fputs("diff is too large, output suppressed.\n", fp);
+ return;
+ }
+
+ /* diff stat */
+- fputs("<b>Diffstat:</b>\n<table>", fp);
++ fputs("<b>diffstat:</b>\n<table>", fp);
+ for (i = 0; i < ci->ndeltas; i++) {
+ delta = git_patch_get_delta(ci->deltas[i]->patch);
+
+@@ -757,11 +757,11 @@ writelogline(FILE *fp, struct commitinfo *ci)
+ fputs("</td><td>", fp);
+ if (ci->author)
+ xmlencode(fp, ci->author->name, strlen(ci->author->name));
+- fputs("</td><td class=\"num\" align=\"right\">", fp);
++ fputs("</td><td class=\"num\">", fp);
+ fprintf(fp, "%zu", ci->filecount);
+- fputs("</td><td class=\"num\" align=\"right\">", fp);
++ fputs("</td><td class=\"num\">", fp);
+ fprintf(fp, "+%zu", ci->addcount);
+- fputs("</td><td class=\"num\" align=\"right\">", fp);
++ fputs("</td><td class=\"num\">", fp);
+ fprintf(fp, "-%zu", ci->delcount);
+ fputs("</td></tr>\n", fp);
+ }
+@@ -885,11 +885,11 @@ printcommitatom(FILE *fp, struct commitinfo *ci, const char *tag)
+ if (ci->parentoid[0])
+ fprintf(fp, "parent %s\n", ci->parentoid);
+ if (ci->author) {
+- fputs("Author: ", fp);
++ fputs("author: ", fp);
+ xmlencode(fp, ci->author->name, strlen(ci->author->name));
+ fputs(" <", fp);
+ xmlencode(fp, ci->author->email, strlen(ci->author->email));
+- fputs(">\nDate: ", fp);
++ fputs(">\ndate: ", fp);
+ printtime(fp, &(ci->author->when));
+ putc('\n', fp);
+ }
+@@ -1078,11 +1078,11 @@ writefilestree(FILE *fp, git_tree *tree, const char *path)
+ percentencode(fp, filepath, strlen(filepath));
+ fputs("\">", fp);
+ xmlencode(fp, entrypath, strlen(entrypath));
+- fputs("</a></td><td class=\"num\" align=\"right\">", fp);
++ fputs("</a></td><td class=\"num\">", fp);
+ if (lc > 0)
+- fprintf(fp, "%zuL", lc);
++ fprintf(fp, "%zul", lc);
+ else
+- fprintf(fp, "%zuB", filesize);
++ fprintf(fp, "%zub", filesize);
+ fputs("</td></tr>\n", fp);
+ git_object_free(obj);
+ } else if (git_tree_entry_type(entry) == GIT_OBJ_COMMIT) {
+@@ -1093,7 +1093,7 @@ writefilestree(FILE *fp, git_tree *tree, const char *path)
+ fputs("</a> @ ", fp);
+ git_oid_tostr(oid, sizeof(oid), git_tree_entry_id(entry));
+ xmlencode(fp, oid, strlen(oid));
+- fputs("</td><td class=\"num\" align=\"right\"></td></tr>\n", fp);
++ fputs("</td><td class=\"num\"></td></tr>\n", fp);
+ }
+ }
+
+@@ -1108,8 +1108,8 @@ writefiles(FILE *fp, const git_oid *id)
+ int ret = -1;
+
+ fputs("<table id=\"files\"><thead>\n<tr>"
+- "<td><b>Mode</b></td><td><b>Name</b></td>"
+- "<td class=\"num\" align=\"right\"><b>Size</b></td>"
++ "<td><b>mode</b></td><td><b>name</b></td>"
++ "<td class=\"num\"><b>size</b></td>"
+ "</tr>\n</thead><tbody>\n", fp);
+
+ if (!git_commit_lookup(&commit, repo, id) &&
+@@ -1130,7 +1130,7 @@ writerefs(FILE *fp)
+ struct referenceinfo *ris = NULL;
+ struct commitinfo *ci;
+ size_t count, i, j, refcount;
+- const char *titles[] = { "Branches", "Tags" };
++ const char *titles[] = { "branches", "tags" };
+ const char *ids[] = { "branches", "tags" };
+ const char *s;
+
+@@ -1148,9 +1148,9 @@ writerefs(FILE *fp)
+ /* print header if it has an entry (first). */
+ if (++count == 1) {
+ fprintf(fp, "<h2>%s</h2><table id=\"%s\">"
+- "<thead>\n<tr><td><b>Name</b></td>"
+- "<td><b>Last commit date</b></td>"
+- "<td><b>Author</b></td>\n</tr>\n"
++ "<thead>\n<tr><td><b>name</b></td>"
++ "<td><b>last commit date</b></td>"
++ "<td><b>author</b></td>\n</tr>\n"
+ "</thead><tbody>\n",
+ titles[j], ids[j]);
+ }
+@@ -1331,12 +1331,12 @@ main(int argc, char *argv[])
+ fp = efopen("log.html", "w");
+ relpath = "";
+ mkdir("commit", S_IRWXU | S_IRWXG | S_IRWXO);
+- writeheader(fp, "Log");
+- fputs("<table id=\"log\"><thead>\n<tr><td><b>Date</b></td>"
+- "<td><b>Commit message</b></td>"
+- "<td><b>Author</b></td><td class=\"num\" align=\"right\"><b>Files</b></td>"
+- "<td class=\"num\" align=\"right\"><b>+</b></td>"
+- "<td class=\"num\" align=\"right\"><b>-</b></td></tr>\n</thead><tbody>\n", fp);
++ writeheader(fp, "log");
++ fputs("<table id=\"log\"><thead>\n<tr><td><b>date</b></td>"
++ "<td><b>commit message</b></td>"
++ "<td><b>author</b></td><td class=\"num\"><b>files</b></td>"
++ "<td class=\"num\"><b>+</b></td>"
++ "<td class=\"num\"><b>-</b></td></tr>\n</thead><tbody>\n", fp);
+
+ if (cachefile && head) {
+ /* read from cache file (does not need to exist) */
+--
+2.51.0
+