]> git.armaanb.net Git - stagit.git/commitdiff
change STAGIT_BASEURL to an -u option and also update the example script
authorHiltjo Posthuma <hiltjo@codemadness.org>
Fri, 5 Mar 2021 11:44:48 +0000 (12:44 +0100)
committerArmaan Bhojwani <me@armaanb.net>
Thu, 8 Apr 2021 01:55:33 +0000 (21:55 -0400)
contrib/example_create.sh
contrib/example_post-receive.sh
man/stagit.1
src/stagit.c

index cf16e1d6f73dca4e8bb35997289600f88ad10a64..cbf9c336a5db924e8fa7176806284412871810ec 100755 (executable)
@@ -31,7 +31,7 @@ for dir in "${reposdir}/"*/; do
 
        mkdir -p "${curdir}/${d}"
        cd "${curdir}/${d}" || continue
 
        mkdir -p "${curdir}/${d}"
        cd "${curdir}/${d}" || continue
-       stagit -c ".cache" "${reposdir}/${r}"
+       stagit -c ".cache" -u "https://git.codemadness.nl/$d/" "${reposdir}/${r}"
 
        # symlinks
        ln -sf log.html index.html
 
        # symlinks
        ln -sf log.html index.html
index c9bcb5e61d048a455652c5d197486bfd82b2e1a2..5e8d32b74ee633154f794efe1fe5afea6e567b93 100755 (executable)
@@ -64,7 +64,7 @@ fi
 stagit-index "${reposdir}/"*/ > "${destdir}/index.html"
 
 # make pages.
 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
 
 ln -sf log.html index.html
 ln -sf ../style.css style.css
index d53595f880dcdb69af47fd2499fd58e58a91227c..c44947657741f3bfb94d81f1cafc069d70923d36 100644 (file)
@@ -8,6 +8,7 @@
 .Nm
 .Op Fl c Ar cachefile
 .Op Fl l Ar commits
 .Nm
 .Op Fl c Ar cachefile
 .Op Fl l Ar commits
+.Op Fl u Ar baseurl
 .Ar repodir
 .Sh DESCRIPTION
 .Nm
 .Ar repodir
 .Sh DESCRIPTION
 .Nm
@@ -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.
 .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
 .El
 .Pp
 The options
@@ -101,12 +105,6 @@ favicon image.
 .It style.css
 CSS stylesheet.
 .El
 .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
 .Sh EXIT STATUS
 .Ex -std
 .Sh SEE ALSO
index bdf2f70fe64568bd4845b0fdbf76dee2d69b4219..337529526ce83964a387f404e87e38a2cda322fe 100644 (file)
@@ -1195,7 +1195,8 @@ err:
 void
 usage(char *argv0)
 {
 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);
 }
 
        exit(1);
 }
 
@@ -1228,6 +1229,10 @@ main(int argc, char *argv[])
                        if (argv[i][0] == '\0' || *p != '\0' ||
                            nlogcommits <= 0 || errno)
                                usage(argv[0]);
                        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)
                }
        }
        if (!repodir)
@@ -1255,9 +1260,6 @@ main(int argc, char *argv[])
        }
 #endif
 
        }
 #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]);
        if (git_repository_open_ext(&repo, repodir,
                GIT_REPOSITORY_OPEN_NO_SEARCH, NULL) < 0) {
                fprintf(stderr, "%s: cannot open repository\n", argv[0]);