]> xenbits.xensource.com Git - people/larsk/xenproject-org-gitdm.git/commitdiff
gitdm: Report progress to stderr not stdout
authorKir Kolyshkin <kir@openvz.org>
Mon, 7 Apr 2008 19:59:18 +0000 (23:59 +0400)
committerJonathan Corbet <corbet@lwn.net>
Fri, 27 Jun 2008 15:02:28 +0000 (09:02 -0600)
When gitdm is used for generating text-only report with its output
redirected to a file, all is well aside from the clutter at the beginning
of that file -- a very long line with repeating "Grabbing changesets...".

Solve that by redirecting progress reporting to stderr. It also helps to
see the progress when you redirect gitdm output to a file.

Also, we don't have to flush stdout since stderr is unbuffered by default.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
gitdm

diff --git a/gitdm b/gitdm
index 32f27c8cb90e2359a43dcf7a7f3445186e616649..d580414b43256b93324d00f83a8051def590ef0b 100755 (executable)
--- a/gitdm
+++ b/gitdm
@@ -447,14 +447,12 @@ ParseOpts ()
 #
 # Snarf changesets.
 #
-print 'Grabbing changesets...\r',
-sys.stdout.flush ()
+print >> sys.stderr, 'Grabbing changesets...\r',
 
 printcount = CSCount = 0
 while (1):
     if (printcount % 50) == 0:
-        print 'Grabbing changesets...%d\r' % printcount,
-        sys.stdout.flush ()
+        print >> sys.stderr, 'Grabbing changesets...%d\r' % printcount,
     printcount += 1
     p = grabpatch()
     if not p:
@@ -469,7 +467,7 @@ while (1):
         for sobemail, sob in p.sobs:
             sob.addsob (p)
     CSCount += 1
-print 'Grabbing changesets...done'
+print >> sys.stderr, 'Grabbing changesets...done'
 
 if DumpDB:
     database.DumpDB ()