if (git_commit_lookup(&(ci->commit), repo, id))
goto err;
- /* TODO: show tags when commit has it */
git_oid_tostr(ci->oid, sizeof(ci->oid), git_commit_id(ci->commit));
git_oid_tostr(ci->parentoid, sizeof(ci->parentoid), git_commit_parent_id(ci->commit, 0));
ci->msg = git_commit_message(ci->commit);
if ((error = git_commit_tree(&(ci->commit_tree), ci->commit)))
- goto err; /* TODO: handle error */
+ goto err;
if (!(error = git_commit_parent(&(ci->parent), ci->commit, 0))) {
if ((error = git_commit_tree(&(ci->parent_tree), ci->parent)))
goto err;
ci->delcount = git_diff_stats_deletions(ci->stats);
ci->filecount = git_diff_stats_files_changed(ci->stats);
- /* TODO: show tag when commit has it */
-
return ci;
err:
{
char tmp[PATH_MAX], *p;
- strlcpy(tmp, path, sizeof(tmp)); /* TODO: bring in libutil? */
+ strlcpy(tmp, path, sizeof(tmp));
for (p = tmp + (tmp[0] == '/'); *p; p++) {
if (*p != '/')
continue;
void
printcommit(FILE *fp, struct commitinfo *ci)
{
- /* TODO: show tag when commit has it */
fprintf(fp, "<b>commit</b> <a href=\"%scommit/%s.html\">%s</a>\n",
relpath, ci->oid, ci->oid);
for (i = 0; i < ndeltas; i++) {
if (git_patch_from_diff(&patch, ci->diff, i)) {
git_patch_free(patch);
- break; /* TODO: handle error */
+ break;
}
delta = git_patch_get_delta(patch);
nhunks = git_patch_num_hunks(patch);
for (j = 0; j < nhunks; j++) {
if (git_patch_get_hunk(&hunk, &nhunklines, patch, j))
- break; /* TODO: handle error ? */
+ break;
fprintf(fp, "<span class=\"h\">%s</span>\n", hunk->header);
git_revwalk_sorting(w, GIT_SORT_TIME);
git_revwalk_simplify_first_parent(w);
- /* TODO: also make "expanded" log ? (with message body) */
fputs("<table id=\"log\"><thead>\n<tr><td>Age</td><td>Commit message</td>"
"<td>Author</td><td>Files</td><td class=\"num\">+</td>"
"<td class=\"num\">-</td></tr>\n</thead><tbody>\n", fp);
filesize = git_blob_rawsize((git_blob *)obj);
fputs("<tr><td>", fp);
- /* TODO: fancy print, like: "-rw-r--r--" */
fprintf(fp, "%u", git_tree_entry_filemode_raw(entry));
fprintf(fp, "</td><td><a href=\"%sfile/", relpath);
xmlencode(fp, filename, strlen(filename));