Introduction
Introduction Statistics Contact Development Disclaimer Help
add abbreviated commit hash to submodule file - stagit-gopher - static git page…
git clone git://git.codemadness.org/stagit-gopher
Log
Files
Refs
README
LICENSE
---
commit f1c1f8c810b311b9f786847dda2494c397cc1ddf
parent 17ce8c9ec7b5fc669fe3c1285c29b5b6fd1a409a
Author: Hiltjo Posthuma <[email protected]>
Date: Tue, 24 Nov 2020 01:23:12 +0100
add abbreviated commit hash to submodule file
sync the similar change as stagit.
Small change: do not align names of submodules anymore because of the
abbreviated commit after the name. Just assume the submodule name is short.
Patch for stagit was from: Oscar Benedito <[email protected]>
Diffstat:
M stagit-gopher.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/stagit-gopher.c b/stagit-gopher.c
@@ -1051,7 +1051,7 @@ writefilestree(FILE *fp, git_tree *tree, const char *path)
git_object *obj = NULL;
git_off_t filesize;
const char *entryname;
- char buf[256], filepath[PATH_MAX], entrypath[PATH_MAX];
+ char buf[256], filepath[PATH_MAX], entrypath[PATH_MAX], oid[8];
size_t count, i, lc;
int r, ret;
@@ -1104,8 +1104,10 @@ writefilestree(FILE *fp, git_tree *tree, const char *pat…
} else if (git_tree_entry_type(entry) == GIT_OBJ_COMMIT) {
/* commit object in tree is a submodule */
fputs("[1|m--------- ", fp);
- utf8pad(buf, sizeof(buf), entrypath, 50, ' ');
- gphlink(fp, buf, strlen(buf));
+ gphlink(fp, entrypath, strlen(entrypath));
+ fputs(" @ ", fp);
+ git_oid_tostr(oid, sizeof(oid), git_tree_entry_id(entr…
+ gphlink(fp, oid, strlen(oid));
fprintf(fp, "|%s/file/.gitmodules.gph|server|port]\n",…
/* NOTE: linecount omitted */
}
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.