tchange STAGIT_BASEURL to an -u option and also update the example script - sta… | |
git clone git://src.adamsgaard.dk/stagit | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit e25c311bf144bbe36fc3ab5c59f9d421dbbaa3b8 | |
parent 266c623668ec1b9be5878043a81c4e37209d6a2e | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Fri, 5 Mar 2021 12:44:48 +0100 | |
change STAGIT_BASEURL to an -u option and also update the example script | |
Diffstat: | |
M example_create.sh | 2 +- | |
M example_post-receive.sh | 2 +- | |
M stagit.1 | 12 +++++------- | |
M stagit.c | 10 ++++++---- | |
4 files changed, 13 insertions(+), 13 deletions(-) | |
--- | |
diff --git a/example_create.sh b/example_create.sh | |
t@@ -31,7 +31,7 @@ for dir in "${reposdir}/"*/; do | |
mkdir -p "${curdir}/${d}" | |
cd "${curdir}/${d}" || continue | |
- stagit -c ".cache" "${reposdir}/${r}" | |
+ stagit -c ".cache" -u "https://git.codemadness.nl/$d/" "${reposdir}/${… | |
# symlinks | |
ln -sf log.html index.html | |
diff --git a/example_post-receive.sh b/example_post-receive.sh | |
t@@ -64,7 +64,7 @@ fi | |
stagit-index "${reposdir}/"*/ > "${destdir}/index.html" | |
# make pages. | |
-stagit -c "${cachefile}" "${reposdir}/${r}" | |
+stagit -c "${cachefile}" -u "https://git.codemadness.nl/$d/" "${reposdir}/${r}" | |
ln -sf log.html index.html | |
ln -sf ../style.css style.css | |
diff --git a/stagit.1 b/stagit.1 | |
t@@ -1,4 +1,4 @@ | |
-.Dd March 4, 2021 | |
+.Dd March 5, 2021 | |
.Dt STAGIT 1 | |
.Os | |
.Sh NAME | |
t@@ -8,6 +8,7 @@ | |
.Nm | |
.Op Fl c Ar cachefile | |
.Op Fl l Ar commits | |
+.Op Fl u Ar baseurl | |
.Ar repodir | |
.Sh DESCRIPTION | |
.Nm | |
t@@ -31,6 +32,9 @@ Write a maximum number of | |
.Ar commits | |
to the log.html file only. | |
However the commit files are written as usual. | |
+.It Fl u Ar baseurl | |
+Base URL to make links in the Atom feeds absolute. | |
+For example: "https://git.codemadness.org/stagit/". | |
.El | |
.Pp | |
The options | |
t@@ -103,12 +107,6 @@ favicon image. | |
.It style.css | |
CSS stylesheet. | |
.El | |
-.Sh ENVIRONMENT | |
-.Bl -tag -width Ds | |
-.It Ev STAGIT_BASEURL | |
-Base URL to make links in atom.xml absolute. | |
-For example: STAGIT_BASE_URL="https://git.codemadness.org/stagit/". | |
-.El | |
.Sh EXIT STATUS | |
.Ex -std | |
.Sh SEE ALSO | |
diff --git a/stagit.c b/stagit.c | |
t@@ -1145,7 +1145,8 @@ writerefs(FILE *fp) | |
void | |
usage(char *argv0) | |
{ | |
- fprintf(stderr, "%s [-c cachefile | -l commits] repodir\n", argv0); | |
+ fprintf(stderr, "%s [-c cachefile | -l commits] " | |
+ "[-u baseurl] repodir\n", argv0); | |
exit(1); | |
} | |
t@@ -1178,6 +1179,10 @@ main(int argc, char *argv[]) | |
if (argv[i][0] == '\0' || *p != '\0' || | |
nlogcommits <= 0 || errno) | |
usage(argv[0]); | |
+ } else if (argv[i][1] == 'u') { | |
+ if (i + 1 >= argc) | |
+ usage(argv[0]); | |
+ baseurl = argv[++i]; | |
} | |
} | |
if (!repodir) | |
t@@ -1205,9 +1210,6 @@ main(int argc, char *argv[]) | |
} | |
#endif | |
- if ((p = getenv("STAGIT_BASEURL"))) | |
- baseurl = p; | |
- | |
if (git_repository_open_ext(&repo, repodir, | |
GIT_REPOSITORY_OPEN_NO_SEARCH, NULL) < 0) { | |
fprintf(stderr, "%s: cannot open repository\n", argv[0]); |