diff
sgit.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/sgit.c b/sgit.c
index 3f52ac9..8fb08b7 100644
--- a/sgit.c
+++ b/sgit.c
@@ -29,6 +29,7 @@ struct repo {
char *branch;
char *cloneurl;
char *head;
+ char *description;
char *last_author;
char *last_date;
char *last_subject;
@@ -545,6 +546,7 @@ add_repo(struct repo **repos, size_t *nrepos, size_t *cap, const char *path)
(*repos)[*nrepos].branch = NULL;
(*repos)[*nrepos].cloneurl = NULL;
(*repos)[*nrepos].head = NULL;
+ (*repos)[*nrepos].description = NULL;
(*repos)[*nrepos].last_author = NULL;
(*repos)[*nrepos].last_date = NULL;
(*repos)[*nrepos].last_subject = NULL;
@@ -775,6 +777,9 @@ load_repo_meta(struct repo *r)
r->cloneurl = read_git_meta_file(r, "cloneurl");
if (r->cloneurl == NULL)
err(1, "malloc");
+ r->description = read_git_meta_file(r, "description");
+ if (r->description == NULL)
+ err(1, "malloc");
free(out);
free(qpath);
@@ -1625,7 +1630,7 @@ make_index(const char *outdir, struct repo *repos, size_t nrepos)
fputs("<link rel=\"stylesheet\" href=\"style.css\">\n", fp);
fputs("<title>git index</title>\n", fp);
fputs("</head>\n<body>\n<h1>Repositories</h1>\n", fp);
- fputs("<table>\n<thead><tr><th>repo</th><th>owner</th><th>branch</th><th>head</th><th>last commit</th></tr></thead>\n<tbody>\n", fp);
+ fputs("<table>\n<thead><tr><th>repo</th><th>owner</th><th>branch</th><th>description</th><th>last commit</th></tr></thead>\n<tbody>\n", fp);
for (i = 0; i < nrepos; i++) {
if (repos[i].head == NULL)
continue;
@@ -1640,9 +1645,9 @@ make_index(const char *outdir, struct repo *repos, size_t nrepos)
write_html_escaped(fp, repos[i].owner);
fputs("</td><td>", fp);
write_html_escaped(fp, repos[i].branch);
- fputs("</td><td><code>", fp);
- write_html_escaped(fp, repos[i].head);
- fputs("</code></td><td>", fp);
+ fputs("</td><td>", fp);
+ write_html_escaped(fp, repos[i].description);
+ fputs("</td><td>", fp);
write_html_escaped(fp, repos[i].last_date);
fputs("</td></tr>\n", fp);
}
@@ -1662,6 +1667,7 @@ free_repos(struct repo *repos, size_t nrepos)
free(repos[i].branch);
free(repos[i].cloneurl);
free(repos[i].head);
+ free(repos[i].description);
free(repos[i].last_author);
free(repos[i].last_date);
free(repos[i].last_subject);