| Date: Fri, 29 Apr 2016 21:14:46 +0200
submodule support
- detect .gitmodules file for submodules, add a link "submodules" to the top menu.
- link each submodule to the .gitmodules file in HEAD.
- revert the special style for modules, but list it as a file "m---------", don't show
the line/filesize though, it is not a file.
Diffstat:
M stagit.c | 24 +++++++++---------------
M style.css | 4 ----
2 files changed, 9 insertions(+), 19 deletions(-)
--- |
| @@ -46,7 +46,7 @@ static char *name = "";
static char *stripped_name;
static char description[255];
static char cloneurl[1024];
-static int hasreadme, haslicense;
+static int haslicense, hasreadme, hassubmodules;
void
commitinfo_free(struct commitinfo *ci)
@@ -251,6 +251,8 @@ writeheader(FILE *fp, const char *title)
fprintf(fp, "Log | ", relpath);
fprintf(fp, "Files | ", relpath);
fprintf(fp, "Refs", relpath);
+ if (hassubmodules)
+ fprintf(fp, " | Submodules", relpath);
if (hasreadme)
fprintf(fp, " | README", relpath);
if (haslicense)
@@ -654,7 +656,7 @@ writefilestree(FILE *fp, git_tree *tree, const char *branch, const char *path)
{
const git_tree_entry *entry = NULL;
git_submodule *module = NULL;
- const char *entryname, *moduleurl;
+ const char *entryname;
char filepath[PATH_MAX], entrypath[PATH_MAX];
git_object *obj = NULL;
git_off_t filesize;
@@ -709,21 +711,11 @@ writefilestree(FILE *fp, git_tree *tree, const char *branch, const char *path)
fprintf(fp, "%juB", (uintmax_t)filesize);
fputs(" |
\n", fp);
} else if (!git_submodule_lookup(&module, repo, entryname)) {
- fputs("