From 5ced189f1993fc17ae683f0a542218db7be7267b Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 5 Mar 2021 12:44:48 +0100 Subject: change STAGIT_BASEURL to an -u option and also update the example script --- stagit.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'stagit.c') diff --git a/stagit.c b/stagit.c index 023ae55..5043c0d 100644 --- a/stagit.c +++ b/stagit.c @@ -1125,7 +1125,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); } @@ -1158,6 +1159,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) @@ -1185,9 +1190,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]); -- cgit v1.2.3