ctucx.git: stagit

ctucx' stagit fork

commit ea2f8521c49df0f10de5e6d8a97842c0df7c47b0
parent 1e35b0fa08a98e532ede60f4add7a91f8030deb6
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date: Thu, 10 Sep 2020 01:11:53 +0200

Add tracked commit short OID to submodules
1 file changed, 6 insertions(+), 1 deletion(-)
M
stagit.c
|
7
++++++-
diff --git a/stagit.c b/stagit.c
@@ -1065,7 +1065,12 @@ writefilestree(FILE *fp, git_tree *tree, const char *path)
 			fprintf(fp, "<tr><td>m---------</td><td><a href=\"%sfile/.gitmodules.html\">",
 				relpath);
 			xmlencode(fp, entrypath, strlen(entrypath));
-			fputs("</a></td><td class=\"num\" align=\"right\"></td></tr>\n", fp);
+			fputs("</a> @ ", fp);
+			const git_oid* oid = git_tree_entry_id(entry);
+			char oidstr[8];
+			git_oid_tostr(oidstr, sizeof(oidstr), oid);
+			fprintf(fp, "%s</td><td class=\"num\" align=\"right\"></td></tr>\n",
+			        oidstr);
 		}
 	}