idetect more names for README and LICENSE - 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 4ae2a118c3f7dd0cc7e7b81289152afbada103bc /scm/stagit-gopher/commit/4ae2a118c3f7dd0cc7e7b81289152afbada103bc.gph bitreich.org 70
1parent 3a00e5bb2bf0415338ff08d1a7bc9a47b4b751e2 /scm/stagit-gopher/commit/3a00e5bb2bf0415338ff08d1a7bc9a47b4b751e2.gph bitreich.org 70
hAuthor: Hiltjo Posthuma <hiltjo@codemadness.org> URL:mailto:hiltjo@codemadness.org bitreich.org 70
iDate: Sun, 11 Nov 2018 19:07:24 +0100 Err bitreich.org 70
i Err bitreich.org 70
idetect more names for README and LICENSE Err bitreich.org 70
i Err bitreich.org 70
i- for license: LICENSE, LICENSE.md, COPYING. Err bitreich.org 70
i- for readme: README, README.md. Err bitreich.org 70
i Err bitreich.org 70
iDiffstat: Err bitreich.org 70
i M stagit-gopher.c | 47 ++++++++++++++++++++----------- Err bitreich.org 70
i Err bitreich.org 70
i1 file changed, 31 insertions(+), 16 deletions(-) Err bitreich.org 70
i--- Err bitreich.org 70
1diff --git a/stagit-gopher.c b/stagit-gopher.c /scm/stagit-gopher/file/stagit-gopher.c.gph bitreich.org 70
i@@ -58,12 +58,17 @@ static char *name = ""; Err bitreich.org 70
i static char *strippedname = ""; Err bitreich.org 70
i static char description[255]; Err bitreich.org 70
i static char cloneurl[1024]; Err bitreich.org 70
i-static int haslicense, hasreadme, hassubmodules, hastagsgph; Err bitreich.org 70
i+static int hastagsgph; Err bitreich.org 70
i+static char *submodules; Err bitreich.org 70
i+static char *licensefiles[] = { "HEAD:LICENSE", "HEAD:LICENSE.md", "HEAD:COPYING" }; Err bitreich.org 70
i+static char *license; Err bitreich.org 70
i+static char *readmefiles[] = { "HEAD:README", "HEAD:README.md" }; Err bitreich.org 70
i+static char *readme; Err bitreich.org 70
i static long long nlogcommits = -1; /* < 0 indicates not used */ Err bitreich.org 70
i Err bitreich.org 70
i /* cache */ Err bitreich.org 70
i static git_oid lastoid; Err bitreich.org 70
i-static char lastoidstr[GIT_OID_HEXSZ + 2]; /* id + newline + nul byte */ Err bitreich.org 70
i+static char lastoidstr[GIT_OID_HEXSZ + 2]; /* id + newline + NUL byte */ Err bitreich.org 70
i static FILE *rcachefp, *wcachefp; Err bitreich.org 70
i static const char *cachefile; Err bitreich.org 70
i Err bitreich.org 70
i@@ -465,12 +470,15 @@ writeheader(FILE *fp, const char *title) Err bitreich.org 70
i fprintf(fp, "[1|Refs|%s/refs.gph|server|port]\n", relpath); Err bitreich.org 70
i if (hastagsgph) Err bitreich.org 70
i fprintf(fp, "[1|Tags|%s/tags.gph|server|port]\n", relpath); Err bitreich.org 70
i- if (hassubmodules) Err bitreich.org 70
i- fprintf(fp, "[1|Submodules|%s/file/.gitmodules.gph|server|port]\n", relpath); Err bitreich.org 70
i- if (hasreadme) Err bitreich.org 70
i- fprintf(fp, "[1|README|%s/file/README.gph|server|port]\n", relpath); Err bitreich.org 70
i- if (haslicense) Err bitreich.org 70
i- fprintf(fp, "[1|LICENSE|%s/file/LICENSE.gph|server|port]\n", relpath); Err bitreich.org 70
i+ if (submodules) Err bitreich.org 70
i+ fprintf(fp, "[1|Submodules|%s/file/%s.gph|server|port]\n", Err bitreich.org 70
i+ relpath, submodules); Err bitreich.org 70
i+ if (readme) Err bitreich.org 70
i+ fprintf(fp, "[1|README|%s/file/%s.gph|server|port]\n", Err bitreich.org 70
i+ relpath, readme); Err bitreich.org 70
i+ if (license) Err bitreich.org 70
i+ fprintf(fp, "[1|LICENSE|%s/file/%s.gph|server|port]\n", Err bitreich.org 70
i+ relpath, license); Err bitreich.org 70
i fputs("---\n", fp); Err bitreich.org 70
i } Err bitreich.org 70
i Err bitreich.org 70
i@@ -1218,17 +1226,24 @@ main(int argc, char *argv[]) Err bitreich.org 70
i hastagsgph = (access("tags.gph", F_OK) == 0); Err bitreich.org 70
i Err bitreich.org 70
i /* check LICENSE */ Err bitreich.org 70
i- haslicense = (!git_revparse_single(&obj, repo, "HEAD:LICENSE") && Err bitreich.org 70
i- git_object_type(obj) == GIT_OBJ_BLOB); Err bitreich.org 70
i- git_object_free(obj); Err bitreich.org 70
i+ for (i = 0; i < sizeof(licensefiles) / sizeof(*licensefiles) && !license; i++) { Err bitreich.org 70
i+ if (!git_revparse_single(&obj, repo, licensefiles[i]) && Err bitreich.org 70
i+ git_object_type(obj) == GIT_OBJ_BLOB) Err bitreich.org 70
i+ license = licensefiles[i] + strlen("HEAD:"); Err bitreich.org 70
i+ git_object_free(obj); Err bitreich.org 70
i+ } Err bitreich.org 70
i Err bitreich.org 70
i /* check README */ Err bitreich.org 70
i- hasreadme = (!git_revparse_single(&obj, repo, "HEAD:README") && Err bitreich.org 70
i- git_object_type(obj) == GIT_OBJ_BLOB); Err bitreich.org 70
i- git_object_free(obj); Err bitreich.org 70
i+ for (i = 0; i < sizeof(readmefiles) / sizeof(*readmefiles) && !readme; i++) { Err bitreich.org 70
i+ if (!git_revparse_single(&obj, repo, readmefiles[i]) && Err bitreich.org 70
i+ git_object_type(obj) == GIT_OBJ_BLOB) Err bitreich.org 70
i+ readme = readmefiles[i] + strlen("HEAD:"); Err bitreich.org 70
i+ git_object_free(obj); Err bitreich.org 70
i+ } Err bitreich.org 70
i Err bitreich.org 70
i- hassubmodules = (!git_revparse_single(&obj, repo, "HEAD:.gitmodules") && Err bitreich.org 70
i- git_object_type(obj) == GIT_OBJ_BLOB); Err bitreich.org 70
i+ if (!git_revparse_single(&obj, repo, "HEAD:.gitmodules") && Err bitreich.org 70
i+ git_object_type(obj) == GIT_OBJ_BLOB) Err bitreich.org 70
i+ submodules = ".gitmodules"; Err bitreich.org 70
i git_object_free(obj); Err bitreich.org 70
i Err bitreich.org 70
i /* log for HEAD */ Err bitreich.org 70
.
Response:
text/plain