From 048df77aa68419a17aeda5330eafa09f9dbdea98 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Mon, 19 Nov 2018 15:42:05 -0500 Subject: [PATCH] redo-log: don't show status line until >1.0 seconds after starting. For very short builds, it looks nicer to not flicker the status line for a split second. --- redo-log.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/redo-log.py b/redo-log.py index 63f5503..1026175 100755 --- a/redo-log.py +++ b/redo-log.py @@ -31,6 +31,7 @@ queue = [] depth = [] total_lines = 0 status = None +start_time = time.time() # regexp for matching "redo" lines in the log, which we use for recursion. @@ -121,7 +122,8 @@ def catlog(t): if not line: was_locked = is_locked(fid) if opt.follow: - if opt.status: + # Don't display status line for extremely short-lived runs + if opt.status and time.time() - start_time > 1.0: width = _tty_width() head = 'redo %s ' % ('{:,}'.format(total_lines)) tail = ''