stagit

Personal fork of stagit

git clone git://mccd.space/stagit
commit de0c5b2e90ba56a30002c0ed04ddc2727276bebb
parent 0945a355ddcc41e2bb1378454633daff743e5067
Author: Marc <marc@coquand.email>
Date:   Thu, 23 Jul 2026 13:17:06 +0200

Add .git/website

Diffstat:
Mstagit.c | 17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/stagit.c b/stagit.c
@@ -67,6 +67,7 @@ static char *strippedname = "";
 static char description[255];
 static char contrib[1024];
 static char blobsurl[1024];
+static char website[1024];
 static char cloneurl[1024];
 static char *submodules;
 static char *licensefiles[] = { "HEAD:LICENSE", "HEAD:LICENSE.md", "HEAD:LICENSE.txt", "HEAD:COPYING" };
@@ -561,6 +562,10 @@ writeheader(FILE *fp, const char *title)
 	  fprintf(fp, " | <a href=\"%s\">Artifacts</a>",
 		  blobsurl);
 	}		
+	if (website[0]) {
+	  fprintf(fp, " | <a href=\"%s\">Website</a>",
+		  website);
+	}		
 	
 	
 	fputs("</td></tr></tbody></table>", fp);
@@ -1344,6 +1349,18 @@ main(int argc, char *argv[])
 		checkfileerror(fpread, path, 'r');
 		fclose(fpread);
 	}
+	/* read website or .git/website */
+	joinpath(path, sizeof(path), repodir, "website");
+	if (!(fpread = fopen(path, "r"))) {
+		joinpath(path, sizeof(path), repodir, ".git/website");
+		fpread = fopen(path, "r");
+	}
+	if (fpread) {
+		if (!fgets(website, sizeof(website), fpread))
+			website[0] = '\0';
+		checkfileerror(fpread, path, 'r');
+		fclose(fpread);
+	}
 	
 
 	/* read url or .git/url */