[PATCH] git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.

Jim Meyering

Signed-off-by: Jim Meyering <[hidden email]>
---
I'm used to filtering git-cvsimport's noisy stderr, but this
diagnostic appears on stdout.  Looks like an oversight.
Now that I'm using cvsps-2.2b1, I see tons of these.

 git-cvsimport.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index e2664ef..e439202 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -952,7 +952,7 @@ while (<CVS>) {
  } elsif (/^-+$/) { # end of unknown-line processing
  $state = 1;
  } elsif ($state != 11) { # ignore stuff when skipping
- print "* UNKNOWN LINE * $_\n";
+ print STDERR "* UNKNOWN LINE * $_\n";
  }
 }
 commit() if $branch and $state != 11;
--
1.6.0.rc1.36.g5ff70
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.

Jeff King
On Tue, Aug 05, 2008 at 04:54:42PM +0200, Jim Meyering wrote:

> I'm used to filtering git-cvsimport's noisy stderr, but this
> diagnostic appears on stdout.  Looks like an oversight.
> Now that I'm using cvsps-2.2b1, I see tons of these.

There are a ton of things that go to stdout:

  $ perl -ne '/print (\S+)/ && print "$1\n" git-cvsimport.perl |
    grep '^#' | wc -l
  18

though many are only activated via "-v". Maybe it is worth putting all
of them to stderr? I really don't see why cvsimport should ever produce
any output on stdout.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.

Jeff King
On Tue, Aug 05, 2008 at 11:28:36AM -0400, Jeff King wrote:

>   $ perl -ne '/print (\S+)/ && print "$1\n" git-cvsimport.perl |
>     grep '^#' | wc -l

Urgh, somehow I managed to get a typo into my cut and paste. It should be

  grep '^"'

(i.e., we are getting rid of "print STDERR" and "print $fh"; this is
admittedly not very robust, but I just wanted an approximation of how
many there were).

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.

Jim Meyering
In reply to this post by Jeff King
Jeff King <[hidden email]> wrote:

> On Tue, Aug 05, 2008 at 04:54:42PM +0200, Jim Meyering wrote:
>
>> I'm used to filtering git-cvsimport's noisy stderr, but this
>> diagnostic appears on stdout.  Looks like an oversight.
>> Now that I'm using cvsps-2.2b1, I see tons of these.
>
> There are a ton of things that go to stdout:
>
>   $ perl -ne '/print (\S+)/ && print "$1\n" git-cvsimport.perl |
>     grep '^#' | wc -l
>   18
>
> though many are only activated via "-v". Maybe it is worth putting all
> of them to stderr? I really don't see why cvsimport should ever produce
> any output on stdout.

A quick scan (post-patch)

    $ grep 'print ' git-cvsimport.perl|grep -vE 'STDERR|opt_v'
    print $f "$_=$conv_author_name{$_} <$conv_author_email{$_}>\n";
    print $fh $line;
    print $fh $buf;
    print $cvspsfh $_;
    print $fh
    print "SKIPPING $fn v $rev\n";

suggests that if you don't count the "SKIPPING..." diagnostic you'd get
for each "-S REGEXP"-skipped name, the "UNKNOWN LINE" diagnostic is the
only one that goes to stdout but that is not protected by an $opt_v guard.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html