skip authorization requests when pulling

Fri, 31 Jan 2025 23:20:20 +0100

author
Mike Becker <universe@uap-core.de>
date
Fri, 31 Jan 2025 23:20:20 +0100
changeset 9
98312f94dbdd
parent 8
6a2e20a4a8ff
child 10
bf159cf9f4b6

skip authorization requests when pulling

src/main.cpp file | annotate | diff | comparison | revisions
--- a/src/main.cpp	Fri Jan 31 23:00:00 2025 +0100
+++ b/src/main.cpp	Fri Jan 31 23:20:20 2025 +0100
@@ -54,7 +54,10 @@
         "You can change the \033[1mdepth\033[22m to support other directory structures.\n\n"
         "When you do not specify \033[1m--no-pull\033[22m, this tool will execute the pull command\n"
         "(and for hg the update command) before retrieving the commit log, assuming\n"
-        "to be on the default branch with \033[4mno uncommitted changes\033[24m.\n\n"
+        "to be on the default branch with \033[4mno uncommitted changes\033[24m. If pulling leads to\n"
+        "an error, an error message is written to stderr and the process continues\n"
+        "with the repository in its current state. This is also the case when pulling\n"
+        "requires authorization.\n\n"
         "Afterwards, this tool prints an HTML page to stdout. A separate heap map is\n"
         "generated for each author showing commits across all repositories, unless the\n"
         "\033[1m--separate\033[22m option is specified in which case each repository is displayed with\n"
@@ -160,14 +163,14 @@
             proc.chdir(repo.path);
             if (repo.type == fm::HG) {
                 proc.setbin(settings.hg);
-                if (proc.exec({"pull"})) {
+                if (proc.exec({"pull", "-y"})) {
                     fprintf(stderr, "Pulling repo '%s' failed!\nMaybe there is no remote?\n", repo.path.c_str());
                 } else if (proc.exec({"update"})) {
                     fprintf(stderr, "Updating repo '%s' failed!\nMaybe there are local changes?\n", repo.path.c_str());
                 }
             } else {
                 proc.setbin(settings.git);
-                if (proc.exec({"pull"})) {
+                if (proc.exec({"pull", "-q"})) {
                     fprintf(stderr, "Pulling repo '%s' failed!\nMaybe there is no remote or there are local changes?\n", repo.path.c_str());
                 }
             }

mercurial