Thread (139 messages) 139 messages, 5 authors, 2021-04-30
STALE1874d
Revisions (3)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]

[PATCH 24/30] subtree: don't let debug and progress output clash

From: Luke Shumaker <hidden>
Date: 2021-04-23 19:43:19
Subsystem: the rest · Maintainer: Linus Torvalds

From: Luke Shumaker <redacted>

Currently, debug output (triggered by passing '-d') and progress output
stomp on eachother.  The debug output is just streamed as lines to
stderr, and the progress output is sent to stderr as '%s\r'.  It is
difficult to distinguish between the debug output and a progress line.
When writing to a terminal the debug lines hide progress lines.

So, when '-d' has been passed, spit out progress as 'progress: %s\n',
instead of as '%s\r', so that it can be detected, and so that the debug
lines don't overwrite the progress when written to a terminal.

Signed-off-by: Luke Shumaker <redacted>
---
 contrib/subtree/git-subtree.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index ddfa74c3bf..62cf54928e 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -53,7 +53,12 @@ debug () {
 progress () {
 	if test -z "$GIT_QUIET"
 	then
-		printf "%s\r" "$*" >&2
+		if test -n "$arg_debug"
+		then
+			printf "progress: %s\n" "$*" >&2
+		else
+			printf "%s\r" "$*" >&2
+		fi
 	fi
 }
 
-- 
2.31.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help