iurmoms-index: kill some lines - stagit-gopher - A git gopher frontend. (mirror) Err bitreich.org 70 hgit clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ URL:git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ bitreich.org 70 1Log /scm/stagit-gopher/log.gph bitreich.org 70 1Files /scm/stagit-gopher/files.gph bitreich.org 70 1Refs /scm/stagit-gopher/refs.gph bitreich.org 70 1Tags /scm/stagit-gopher/tag bitreich.org 70 1README /scm/stagit-gopher/file/README.gph bitreich.org 70 1LICENSE /scm/stagit-gopher/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit 2e4ed81390ff8ed331d10d3fba13dfdc2f6b6b20 /scm/stagit-gopher/commit/2e4ed81390ff8ed331d10d3fba13dfdc2f6b6b20.gph bitreich.org 70 1parent 75cba4e6fd3b32d5477312f0174f01d830a2d341 /scm/stagit-gopher/commit/75cba4e6fd3b32d5477312f0174f01d830a2d341.gph bitreich.org 70 hAuthor: Hiltjo Posthuma URL:mailto:hiltjo@codemadness.org bitreich.org 70 iDate: Sun, 20 Dec 2015 21:13:54 +0100 Err bitreich.org 70 i Err bitreich.org 70 iurmoms-index: kill some lines Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M urmoms-index.c | 104 +++---------------------------- Err bitreich.org 70 i Err bitreich.org 70 i1 file changed, 9 insertions(+), 95 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/urmoms-index.c b/urmoms-index.c /scm/stagit-gopher/file/urmoms-index.c.gph bitreich.org 70 i@@ -13,28 +13,6 @@ Err bitreich.org 70 i #include "config.h" Err bitreich.org 70 i #include "git2.h" Err bitreich.org 70 i Err bitreich.org 70 i-struct commitinfo { Err bitreich.org 70 i- const git_oid *id; Err bitreich.org 70 i- Err bitreich.org 70 i- char oid[GIT_OID_HEXSZ + 1]; Err bitreich.org 70 i- char parentoid[GIT_OID_HEXSZ + 1]; Err bitreich.org 70 i- Err bitreich.org 70 i- const git_signature *author; Err bitreich.org 70 i- const char *summary; Err bitreich.org 70 i- const char *msg; Err bitreich.org 70 i- Err bitreich.org 70 i- git_diff_stats *stats; Err bitreich.org 70 i- git_diff *diff; Err bitreich.org 70 i- git_commit *commit; Err bitreich.org 70 i- git_commit *parent; Err bitreich.org 70 i- git_tree *commit_tree; Err bitreich.org 70 i- git_tree *parent_tree; Err bitreich.org 70 i- Err bitreich.org 70 i- size_t addcount; Err bitreich.org 70 i- size_t delcount; Err bitreich.org 70 i- size_t filecount; Err bitreich.org 70 i-}; Err bitreich.org 70 i- Err bitreich.org 70 i static git_repository *repo; Err bitreich.org 70 i Err bitreich.org 70 i static const char *relpath = ""; Err bitreich.org 70 i@@ -44,73 +22,6 @@ static char description[255] = "Repositories"; Err bitreich.org 70 i static char name[255]; Err bitreich.org 70 i static char owner[255]; Err bitreich.org 70 i Err bitreich.org 70 i-void Err bitreich.org 70 i-commitinfo_free(struct commitinfo *ci) Err bitreich.org 70 i-{ Err bitreich.org 70 i- if (!ci) Err bitreich.org 70 i- return; Err bitreich.org 70 i- Err bitreich.org 70 i- git_diff_stats_free(ci->stats); Err bitreich.org 70 i- git_diff_free(ci->diff); Err bitreich.org 70 i- git_tree_free(ci->commit_tree); Err bitreich.org 70 i- git_tree_free(ci->parent_tree); Err bitreich.org 70 i- git_commit_free(ci->commit); Err bitreich.org 70 i-} Err bitreich.org 70 i- Err bitreich.org 70 i-struct commitinfo * Err bitreich.org 70 i-commitinfo_getbyoid(const git_oid *id) Err bitreich.org 70 i-{ Err bitreich.org 70 i- struct commitinfo *ci; Err bitreich.org 70 i- git_diff_options opts; Err bitreich.org 70 i- int error; Err bitreich.org 70 i- Err bitreich.org 70 i- if (!(ci = calloc(1, sizeof(struct commitinfo)))) Err bitreich.org 70 i- err(1, "calloc"); Err bitreich.org 70 i- Err bitreich.org 70 i- ci->id = id; Err bitreich.org 70 i- if (git_commit_lookup(&(ci->commit), repo, id)) Err bitreich.org 70 i- goto err; Err bitreich.org 70 i- Err bitreich.org 70 i- /* TODO: show tags when commit has it */ Err bitreich.org 70 i- git_oid_tostr(ci->oid, sizeof(ci->oid), git_commit_id(ci->commit)); Err bitreich.org 70 i- git_oid_tostr(ci->parentoid, sizeof(ci->parentoid), git_commit_parent_id(ci->commit, 0)); Err bitreich.org 70 i- Err bitreich.org 70 i- ci->author = git_commit_author(ci->commit); Err bitreich.org 70 i- ci->summary = git_commit_summary(ci->commit); Err bitreich.org 70 i- ci->msg = git_commit_message(ci->commit); Err bitreich.org 70 i- Err bitreich.org 70 i- if ((error = git_commit_tree(&(ci->commit_tree), ci->commit))) Err bitreich.org 70 i- goto err; /* TODO: handle error */ Err bitreich.org 70 i- if (!(error = git_commit_parent(&(ci->parent), ci->commit, 0))) { Err bitreich.org 70 i- if ((error = git_commit_tree(&(ci->parent_tree), ci->parent))) Err bitreich.org 70 i- goto err; Err bitreich.org 70 i- } else { Err bitreich.org 70 i- ci->parent = NULL; Err bitreich.org 70 i- ci->parent_tree = NULL; Err bitreich.org 70 i- } Err bitreich.org 70 i- Err bitreich.org 70 i- git_diff_init_options(&opts, GIT_DIFF_OPTIONS_VERSION); Err bitreich.org 70 i- opts.flags |= GIT_DIFF_DISABLE_PATHSPEC_MATCH; Err bitreich.org 70 i- if ((error = git_diff_tree_to_tree(&(ci->diff), repo, ci->parent_tree, ci->commit_tree, &opts))) Err bitreich.org 70 i- goto err; Err bitreich.org 70 i- if (git_diff_get_stats(&(ci->stats), ci->diff)) Err bitreich.org 70 i- goto err; Err bitreich.org 70 i- Err bitreich.org 70 i- ci->addcount = git_diff_stats_insertions(ci->stats); Err bitreich.org 70 i- ci->delcount = git_diff_stats_deletions(ci->stats); Err bitreich.org 70 i- ci->filecount = git_diff_stats_files_changed(ci->stats); Err bitreich.org 70 i- Err bitreich.org 70 i- /* TODO: show tag when commit has it */ Err bitreich.org 70 i- Err bitreich.org 70 i- return ci; Err bitreich.org 70 i- Err bitreich.org 70 i-err: Err bitreich.org 70 i- commitinfo_free(ci); Err bitreich.org 70 i- free(ci); Err bitreich.org 70 i- Err bitreich.org 70 i- return NULL; Err bitreich.org 70 i-} Err bitreich.org 70 i- Err bitreich.org 70 i FILE * Err bitreich.org 70 i efopen(const char *name, const char *flags) Err bitreich.org 70 i { Err bitreich.org 70 i@@ -211,7 +122,8 @@ writefooter(FILE *fp) Err bitreich.org 70 i int Err bitreich.org 70 i writelog(FILE *fp) Err bitreich.org 70 i { Err bitreich.org 70 i- struct commitinfo *ci; Err bitreich.org 70 i+ git_commit *commit = NULL; Err bitreich.org 70 i+ const git_signature *author; Err bitreich.org 70 i git_revwalk *w = NULL; Err bitreich.org 70 i git_oid id; Err bitreich.org 70 i int ret = 0; Err bitreich.org 70 i@@ -222,11 +134,13 @@ writelog(FILE *fp) Err bitreich.org 70 i git_revwalk_simplify_first_parent(w); Err bitreich.org 70 i Err bitreich.org 70 i if (git_revwalk_next(&id, w) || Err bitreich.org 70 i- !(ci = commitinfo_getbyoid(&id))) { Err bitreich.org 70 i+ git_commit_lookup(&commit, repo, &id)) { Err bitreich.org 70 i ret = -1; Err bitreich.org 70 i goto err; Err bitreich.org 70 i } Err bitreich.org 70 i Err bitreich.org 70 i+ author = git_commit_author(commit); Err bitreich.org 70 i+ Err bitreich.org 70 i fputs("", fp); Err bitreich.org 70 i@@ -236,10 +150,11 @@ writelog(FILE *fp) Err bitreich.org 70 i fputs("", fp); Err bitreich.org 70 i xmlencode(fp, owner, strlen(owner)); Err bitreich.org 70 i fputs("", fp); Err bitreich.org 70 i- if (ci->author) Err bitreich.org 70 i- printtimeshort(fp, &(ci->author->when)); Err bitreich.org 70 i+ if (author) Err bitreich.org 70 i+ printtimeshort(fp, &(author->when)); Err bitreich.org 70 i fputs("", fp); Err bitreich.org 70 i Err bitreich.org 70 i+ git_commit_free(commit); Err bitreich.org 70 i err: Err bitreich.org 70 i git_revwalk_free(w); Err bitreich.org 70 i Err bitreich.org 70 i@@ -252,8 +167,7 @@ main(int argc, char *argv[]) Err bitreich.org 70 i const git_error *e = NULL; Err bitreich.org 70 i FILE *fp; Err bitreich.org 70 i char path[PATH_MAX], *p; Err bitreich.org 70 i- int status; Err bitreich.org 70 i- size_t i; Err bitreich.org 70 i+ int i, status; Err bitreich.org 70 i Err bitreich.org 70 i if (argc < 2) { Err bitreich.org 70 i fprintf(stderr, "%s [repodir...]\n", argv[0]); Err bitreich.org 70 .