diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2016-05-06 11:49:25 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2016-05-06 11:49:25 +0200 |
commit | c6e8f9fd809cc16960022c344b42be77229a70c6 (patch) | |
tree | b8273198eb28e066bb91768f2fdd12892d941633 /stagit.c | |
parent | 543582034eed3faf6120de321354f36ec8a2c0b4 (diff) |
make diffstat files an anchor (jump to delta)
Diffstat (limited to 'stagit.c')
-rw-r--r-- | stagit.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -462,7 +462,7 @@ printshowfile(FILE *fp, struct commitinfo *ci) fputs("<b>Diffstat:</b>\n<table>", fp); for (i = 0; i < ci->ndeltas; i++) { delta = git_patch_get_delta(ci->deltas[i]->patch); - fputs("<tr><td>", fp); + fprintf(fp, "<tr><td><a href=\"#h%zu\">", i); xmlencode(fp, delta->old_file.path, strlen(delta->old_file.path)); if (strcmp(delta->old_file.path, delta->new_file.path)) { fputs(" -> ", fp); @@ -482,7 +482,7 @@ printshowfile(FILE *fp, struct commitinfo *ci) memset(&linestr, '+', add); memset(&linestr[add], '-', del); - fprintf(fp, "</td><td> | </td><td class=\"num\">%zu</td><td><span class=\"i\">", + fprintf(fp, "</a></td><td> | </td><td class=\"num\">%zu</td><td><span class=\"i\">", ci->deltas[i]->addcount + ci->deltas[i]->delcount); fwrite(&linestr, 1, add, fp); fputs("</span><span class=\"d\">", fp); @@ -499,8 +499,8 @@ printshowfile(FILE *fp, struct commitinfo *ci) for (i = 0; i < ci->ndeltas; i++) { patch = ci->deltas[i]->patch; delta = git_patch_get_delta(patch); - fprintf(fp, "<b>diff --git a/<a href=\"%sfile/%s.html\">%s</a> b/<a href=\"%sfile/%s.html\">%s</a></b>\n", - relpath, delta->old_file.path, delta->old_file.path, + fprintf(fp, "<b>diff --git a/<a id=\"h%zu\" href=\"%sfile/%s.html\">%s</a> b/<a href=\"%sfile/%s.html\">%s</a></b>\n", + i, relpath, delta->old_file.path, delta->old_file.path, relpath, delta->new_file.path, delta->new_file.path); /* check binary data */ |