]> git.armaanb.net Git - stagit.git/blobdiff - stagit.c
stagit: log: indicate when using the -l option and there are more commits
[stagit.git] / stagit.c
index 6c9b5c0def1b3ac717abe3629782dd1a0cad1504..a70a2224ca19a409e577a39cffa68c6775b79953 100644 (file)
--- a/stagit.c
+++ b/stagit.c
@@ -65,10 +65,6 @@ static char lastoidstr[GIT_OID_HEXSZ + 2]; /* id + newline + nul byte */
 static FILE *rcachefp, *wcachefp;
 static const char *cachefile;
 
-#ifndef USE_PLEDGE
-#define pledge(p1,p2) 0
-#endif
-
 void
 joinpath(char *buf, size_t bufsiz, const char *path, const char *path2)
 {
@@ -606,6 +602,10 @@ writelog(FILE *fp, const git_oid *oid)
                } else if (nlogcommits > 0) {
                        writelogline(fp, ci);
                        nlogcommits--;
+                       if (!nlogcommits && ci->parentoid[0])
+                               fputs("<tr><td></td><td colspan=\"5\">"
+                                     "More commits remaining [...]</td>"
+                                     "</tr>\n", fp);
                }
 
                if (cachefile)
@@ -1010,7 +1010,7 @@ err:
 void
 usage(char *argv0)
 {
-       fprintf(stderr, "%s [-c cachefile] [-l commits] repodir\n", argv0);
+       fprintf(stderr, "%s [-c cachefile | -l commits] repodir\n", argv0);
        exit(1);
 }
 
@@ -1027,9 +1027,6 @@ main(int argc, char *argv[])
        size_t n;
        int i, fd;
 
-       if (pledge("stdio rpath wpath cpath fattr", NULL) == -1)
-               err(1, "pledge");
-
        for (i = 1; i < argc; i++) {
                if (argv[i][0] != '-') {
                        if (repodir)
@@ -1052,8 +1049,6 @@ main(int argc, char *argv[])
                                usage(argv[0]);
                }
        }
-       if (!cachefile && pledge("stdio rpath wpath cpath", NULL) == -1)
-               err(1, "pledge");
        if (!repodir)
                usage(argv[0]);
 
@@ -1062,6 +1057,16 @@ main(int argc, char *argv[])
 
        git_libgit2_init();
 
+#ifdef __OpenBSD__
+       if (cachefile) {
+               if (pledge("stdio rpath wpath cpath fattr", NULL) == -1)
+                       err(1, "pledge");
+       } else {
+               if (pledge("stdio rpath wpath cpath", NULL) == -1)
+                       err(1, "pledge");
+       }
+#endif
+
        if (git_repository_open_ext(&repo, repodir,
                GIT_REPOSITORY_OPEN_NO_SEARCH, NULL) < 0) {
                e = giterr_last();