All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Print progress message to stderr, not stdout
@ 2006-11-11 12:16 Karl Hasselström
  2006-12-02 13:20 ` Marco Costalba
  0 siblings, 1 reply; 10+ messages in thread
From: Karl Hasselström @ 2006-11-11 12:16 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

Printing progress messages to stdout causes them to get mixed up with
the actual output of the program. Using stderr is much better, since
the user can then redirect the two components separately.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---

I noticed this when creating a patch with "stg export -s" for the
import regression test.

 stgit/git.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/stgit/git.py b/stgit/git.py
index 2a6ae91..8d88769 100644
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -186,8 +186,8 @@ def __tree_status(files = None, tree_id
     """Returns a list of pairs - [status, filename]
     """
     if verbose:
-        print 'Checking for changes in the working directory...',
-        sys.stdout.flush()
+        sys.stderr.write('Checking for changes in the working directory...')
+        sys.stderr.flush()
 
     refresh_index()
 
@@ -226,7 +226,7 @@ def __tree_status(files = None, tree_id
             cache_files.append(fs)
 
     if verbose:
-        print 'done'
+        print >> sys.stderr, 'done'
 
     return cache_files

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-12-05  9:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-11 12:16 [PATCH] Print progress message to stderr, not stdout Karl Hasselström
2006-12-02 13:20 ` Marco Costalba
2006-12-04  9:17   ` Catalin Marinas
2006-12-04 15:37     ` Karl Hasselström
2006-12-04 18:34       ` Marco Costalba
2006-12-04 22:13         ` Catalin Marinas
2006-12-05  6:11           ` Marco Costalba
2006-12-05  7:41           ` Johannes Schindelin
2006-12-05  9:06             ` Karl Hasselström
2006-12-05  9:06             ` Catalin Marinas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.