rate limit progress messages main
authorFrédéric Péters <fpeters@0d.be>
Mon, 6 Sep 2021 13:19:20 +0000 (15:19 +0200)
committerFrédéric Péters <fpeters@0d.be>
Mon, 6 Sep 2021 13:21:21 +0000 (15:21 +0200)
git-acab

index 9645ac2..4cd9839 100755 (executable)
--- a/git-acab
+++ b/git-acab
@@ -30,11 +30,13 @@ def amend_commit(start_timestamp):
     )
     authored_timestamp = start_timestamp
     base_env = os.environ
+    last_print = 0
     while True:
         authored_timestamp -= 1
         for committed_timestamp in range(start_timestamp, authored_timestamp, -1):
             counter += 1
-            if not args.quiet:
+            if not args.quiet and time.time() - last_print > 0.05:
+                last_print = time.time()
                 print(
                     '%5d - %s - %s - [%s:%02d]'
                     % (