[PATCH] Print progress message to stderr, not stdout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---

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
 
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]