stagit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 219bb57fa0c95190547bf50a63fd41783052d0ca
parent 0ab62ec090143dd22ec5ebf0d962033e1d3d558a
Author: quantumish <freifeld.david@gmail.com>
Date:   Thu, 23 Jul 2026 05:17:42 +0100

Remove repo owner, add "last development" commit

Diffstat:
Mstagit-index.c | 33++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/stagit-index.c b/stagit-index.c @@ -13,8 +13,8 @@ static git_repository *repo; static const char *relpath = ""; static char description[255] = "Repositories"; +static char last_development[41] = ""; static char *name = ""; -static char owner[255]; /* Handle read or write errors for a FILE * stream */ void @@ -110,8 +110,8 @@ writeheader(FILE *fp) fputs("</span></td></tr><tr><td></td><td>\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>Last development</b></td></tr>" "</thead><tbody>\n", fp); } @@ -134,8 +134,13 @@ writelog(FILE *fp) git_revwalk_new(&w, repo); git_revwalk_push_head(w); - if (git_revwalk_next(&id, w) || - git_commit_lookup(&commit, repo, &id)) { + if (git_oid_fromstr(&id, last_development) && + git_revwalk_next(&id, w)) { + ret = -1; + goto err; + } + + if (git_commit_lookup(&commit, repo, &id)) { ret = -1; goto err; } @@ -156,8 +161,6 @@ writelog(FILE *fp) fputs("</a></td><td>", fp); xmlencode(fp, description, strlen(description)); fputs("</td><td>", fp); - xmlencode(fp, owner, strlen(owner)); - fputs("</td><td>", fp); if (author) printtimeshort(fp, &(author->when)); fputs("</td></tr>", fp); @@ -230,20 +233,20 @@ main(int argc, char *argv[]) fclose(fp); } - /* read owner or .git/owner */ - joinpath(path, sizeof(path), repodir, "owner"); + /* read last-development or .git/last-development */ + joinpath(path, sizeof(path), repodir, "last-development"); if (!(fp = fopen(path, "r"))) { - joinpath(path, sizeof(path), repodir, ".git/owner"); + joinpath(path, sizeof(path), repodir, ".git/last-development"); fp = fopen(path, "r"); } - owner[0] = '\0'; + last_development[0] = '\0'; if (fp) { - if (!fgets(owner, sizeof(owner), fp)) - owner[0] = '\0'; - checkfileerror(fp, "owner", 'r'); + if (!fgets(last_development, sizeof(last_development), fp)) + last_development[0] = '\0'; + checkfileerror(fp, "last-development", 'r'); fclose(fp); - owner[strcspn(owner, "\n")] = '\0'; } + writelog(stdout); } writefooter(stdout);