Debian Bug report logs - #170947
diffstat: option to make it usable in pipes

version graph

Package: diffstat; Maintainer for diffstat is Sandro Tosi <morph@debian.org>; Source for diffstat is src:diffstat.

Reported by: Richard Braakman <dark@xs4all.nl>

Date: Wed, 27 Nov 2002 15:48:06 UTC

Severity: wishlist

Tags: upstream

Found in version 1.31-2

Done: Greg Norris <haphazard@kc.rr.com>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Greg Norris <adric@debian.org>, diffstat@packages.qa.debian.org:
Bug#170947; Package diffstat. Full text and rfc822 format available.

Acknowledgement sent to Richard Braakman <dark@xs4all.nl>:
New Bug report received and forwarded. Copy sent to Greg Norris <adric@debian.org>, diffstat@packages.qa.debian.org. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Richard Braakman <dark@xs4all.nl>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: diffstat: option to make it usable in pipes
Date: Wed, 27 Nov 2002 17:42:05 +0200
Package: diffstat
Version: 1.31-2
Severity: wishlist
Tags: upstream


Hello,

Diffstat prints progress information on stderr if its output is not
going to a tty.  This can be difficult for programs such a Lintian that
run diffstat as a subprocess, because the dots interfere with their
normal output.  They can of course redirect stderr to /dev/null (which
Lintian currently does), but that suppresses real error messages as well.

I've attached a patch that adds a -q (quiet) option to diffstat to
show what I mean.

Note that since this progress information also interferes with for
example piping the output through a pager, it might be better to
make not printing it the default, and add an option to print it.
With that change, diffstat could also stop caring about whether
its output is a tty or not.

Richard Braakman


diff -ur diffstat-1.31.orig/diffstat.1 diffstat-1.31/diffstat.1
--- diffstat-1.31.orig/diffstat.1	2002-08-21 02:24:47.000000000 +0300
+++ diffstat-1.31/diffstat.1	2002-11-27 17:17:36.000000000 +0200
@@ -86,6 +86,10 @@
 override the logic that strips common pathnames, simulating the \fBpatch\fP
 "-p" option.
 .TP
+.B \-q
+suppress the progress information that's printed to stderr when \fBdiffstat\fP
+is used as a filter.
+.TP
 .B \-u
 suppress the sorting of filenames in the report.
 .TP
diff -ur diffstat-1.31.orig/diffstat.c diffstat-1.31/diffstat.c
--- diffstat-1.31.orig/diffstat.c	2002-08-21 02:38:52.000000000 +0300
+++ diffstat-1.31/diffstat.c	2002-11-27 17:15:44.000000000 +0200
@@ -792,7 +792,7 @@
     piped_output = !isatty(fileno(stdout))
 	&& isatty(fileno(stderr));
 
-    while ((j = getopt(argc, argv, "cf:kn:p:uw:V")) != EOF) {
+    while ((j = getopt(argc, argv, "cf:kn:p:quw:V")) != EOF) {
 	switch (j) {
 	case 'c':
 	    comment_opt = "#";
@@ -809,6 +809,9 @@
 	case 'p':
 	    prefix_opt = atoi(optarg);
 	    break;
+	case 'q':
+	    piped_output = 0;
+	    break;
 	case 'u':
 	    sort_names = 0;
 	    break;




Reply sent to Greg Norris <haphazard@kc.rr.com>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Richard Braakman <dark@xs4all.nl>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #10 received at 170947-done@bugs.debian.org (full text, mbox):

From: Greg Norris <haphazard@kc.rr.com>
To: 170947-done@bugs.debian.org
Subject: Re: Bug#170947: diffstat: option to make it usable in pipes
Date: Thu, 2 Jan 2003 19:53:14 -0600
[Message part 1 (text/plain, inline)]
Never get distracted when updating the changelog... I tried to re-close
an old bug instead of this one.  Sheesh!

Anyway, I've uploaded version 1.31-3 which includes the patch.
Hopefully it will hit the archives sometime tomorrow.  It's been
forwarded upstream for consideration as well.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, diffstat@packages.qa.debian.org:
Bug#170947; Package diffstat. Full text and rfc822 format available.

Acknowledgement sent to Greg Norris <adric@debian.org>:
Extra info received and forwarded to list. Copy sent to diffstat@packages.qa.debian.org. Full text and rfc822 format available.

Message #15 received at 170947@bugs.debian.org (full text, mbox):

From: Greg Norris <adric@debian.org>
To: Richard Braakman <dark@xs4all.nl>
Cc: 170947@bugs.debian.org
Subject: Re: Bug#170947: diffstat: option to make it usable in pipes
Date: Mon, 13 Jan 2003 18:30:51 -0600
[Message part 1 (text/plain, inline)]
Upstream has decided to make diffstat quiet by default, and added the
"-v" option to request verbose output... I've therefore removed the "-q"
flag from version 1.32-1, which has just been uploaded.  Hopefully this
won't cause undue problems to anyone, as version 1.31-3 has not been
available for very long (and only in unstable).
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Greg Norris <adric@debian.org>, diffstat@packages.qa.debian.org:
Bug#170947; Package diffstat. Full text and rfc822 format available.

Acknowledgement sent to Richard Braakman <dark@xs4all.nl>:
Extra info received and forwarded to list. Copy sent to Greg Norris <adric@debian.org>, diffstat@packages.qa.debian.org. Full text and rfc822 format available.

Message #20 received at 170947@bugs.debian.org (full text, mbox):

From: Richard Braakman <dark@xs4all.nl>
To: 170947@bugs.debian.org
Cc: jrodin@jagor.srce.hr
Subject: Re: Bug#170947: diffstat: option to make it usable in pipes
Date: Tue, 14 Jan 2003 06:00:41 +0200
On Mon, Jan 13, 2003 at 06:30:51PM -0600, Greg Norris wrote:
> Upstream has decided to make diffstat quiet by default, and added the
> "-v" option to request verbose output... I've therefore removed the "-q"
> flag from version 1.32-1, which has just been uploaded.  Hopefully this
> won't cause undue problems to anyone, as version 1.31-3 has not been
> available for very long (and only in unstable).

Okay, that's great!  I think that's a better solution anyway, and
the pain of removing -q from a potential handful of scripts is a small
price to pay.  Lintian hasn't been modified yet to use -q, so no
problems there.  Now it can depend on diffstat (>= 1.32) and drop
the crapalicious stderr handling :-)

Richard Braakman



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 12:48:49 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.