GNU bug report logs - #10967
Weird 'du' behavior. Bug in coreutils-8.15 ?

Previous Next

Package: coreutils;

Reported by: Daniel Stavrovski <d <at> stavrovski.net>

Date: Thu, 8 Mar 2012 00:50:03 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10967 in the body.
You can then email your comments to 10967 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

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


Report forwarded to bug-coreutils <at> gnu.org:
bug#10967; Package coreutils. (Thu, 08 Mar 2012 00:50:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Stavrovski <d <at> stavrovski.net>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 08 Mar 2012 00:50:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Stavrovski <d <at> stavrovski.net>
To: bug-coreutils <at> gnu.org
Subject: Weird 'du' behavior. Bug in coreutils-8.15 ?
Date: Wed, 7 Mar 2012 18:46:09 -0600
[Message part 1 (text/plain, inline)]
┌─[01:17:15]-[root <at> stavrovski]-[~]
└─› mkdir /tmp/another_test/ && for i in $(seq 1 20); do dd if=/dev/zero
of=/tmp/another_test/file-$i  bs=1024  count=10240 ; done

┌─[01:17:17]-[root <at> stavrovski]-[~]
└─› ls -1 /tmp/another_test/* | wc -l
20

┌─[01:17:36]-[root <at> stavrovski]-[~]
└─› du -csxh /tmp/another_test/*
0       total

┌─[01:28:19]-[root <at> stavrovski]-[~]
└─› du --version
du (GNU coreutils) 8.15
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjörn Granlund, David MacKenzie, Paul Eggert,
and Jim Meyering.

┌─[01:39:04]-[root <at> stavrovski]-[~]
└─› cat /etc/issue
Arch Linux \r (\l)

┌─[01:39:22]-[root <at> stavrovski]-[~]
└─› pacman -Qs coreutils
local/coreutils 8.15-1 (base)

with coreutils-8.14 du is working as expected.

strace => http://pastebin.com/dPAKCNwF

-- 

An Educated Fool
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#10967; Package coreutils. (Thu, 08 Mar 2012 08:21:02 GMT) Full text and rfc822 format available.

Message #8 received at 10967 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Daniel Stavrovski <d <at> stavrovski.net>
Cc: 10967 <at> debbugs.gnu.org
Subject: Re: bug#10967: Weird 'du' behavior. Bug in coreutils-8.15 ?
Date: Thu, 08 Mar 2012 09:19:41 +0100
Daniel Stavrovski wrote:
> ┌─[01:17:15]-[root <at> stavrovski]-[~]
> └─› mkdir /tmp/another_test/ && for i in $(seq 1 20); do dd if=/dev/zero
> of=/tmp/another_test/file-$i  bs=1024  count=10240 ; done
>
> ┌─[01:17:17]-[root <at> stavrovski]-[~]
> └─› ls -1 /tmp/another_test/* | wc -l
> 20
>
> ┌─[01:17:36]-[root <at> stavrovski]-[~]
> └─› du -csxh /tmp/another_test/*
> 0       total
>
> ┌─[01:28:19]-[root <at> stavrovski]-[~]
> └─› du --version
> du (GNU coreutils) 8.15

Oh!  That's a regression.
Thank you for finding/reporting it!

Here's the fix I expect to use:

diff --git a/src/du.c b/src/du.c
index e4e36df..c1c0417 100644
--- a/src/du.c
+++ b/src/du.c
@@ -443,7 +443,9 @@ process_file (FTS *fts, FTSENT *ent)
               return false;
             }

-          if (fts->fts_options & FTS_XDEV && fts->fts_dev != sb->st_dev)
+          if (fts->fts_options & FTS_XDEV
+              && FTS_ROOTLEVEL < ent->fts_level
+              && fts->fts_dev != sb->st_dev)
             excluded = true;
         }




Information forwarded to bug-coreutils <at> gnu.org:
bug#10967; Package coreutils. (Thu, 08 Mar 2012 10:39:02 GMT) Full text and rfc822 format available.

Message #11 received at 10967 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Daniel Stavrovski <d <at> stavrovski.net>
Cc: 10967 <at> debbugs.gnu.org
Subject: Re: bug#10967: Weird 'du' behavior. Bug in coreutils-8.15 ?
Date: Thu, 08 Mar 2012 11:36:46 +0100
Jim Meyering wrote:
...
>> du (GNU coreutils) 8.15
>
> Oh!  That's a regression.
> Thank you for finding/reporting it!
>
> Here's the fix I expect to use:
>
> diff --git a/src/du.c b/src/du.c
> index e4e36df..c1c0417 100644
> --- a/src/du.c
> +++ b/src/du.c
> @@ -443,7 +443,9 @@ process_file (FTS *fts, FTSENT *ent)
>                return false;
>              }
>
> -          if (fts->fts_options & FTS_XDEV && fts->fts_dev != sb->st_dev)
> +          if (fts->fts_options & FTS_XDEV
> +              && FTS_ROOTLEVEL < ent->fts_level
> +              && fts->fts_dev != sb->st_dev)
>              excluded = true;
>          }

Thanks again.
A small reproducer is to run this:

    du -x /etc/passwd

If it prints nothing (coreutils-8.15), you have the bug.

Here is a complete patch:

From b51e77776fbc4c8fa6727388b735427596595477 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering <at> redhat.com>
Date: Thu, 8 Mar 2012 10:33:50 +0100
Subject: [PATCH] du: --one-file-system (-x) ignores non-directory arguments

Surprise!  "du -x non-DIR" would print nothing.
Note that the problem arises only when processing a non-directory
specified on the command line.  Not surprisingly, "du -x" still
works as expected for any directory argument.

When performing its same-file-system check, du may skip an entry
only if it is at fts_level 1 or greater.  Command-line arguments
are at fts_level == 0 (FTS_ROOTLEVEL).

* src/du.c (process_file): Don't use the top-level FTS->fts_dev
when testing for --one-file-system (-x).  It happens to be valid
for directories, but it is always 0 for a non-directory.
* tests/du/one-file-system: Add tests for this.
* NEWS (Bug fixes): Mention it.
Reported by Daniel Stavrovski in http://bugs.gnu.org/10967.
Introduced by commit v8.14-95-gcfe1040.
---
 NEWS                     |    4 ++++
 THANKS.in                |    1 +
 src/du.c                 |    9 ++++++++-
 tests/du/one-file-system |   10 +++++++++-
 4 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 04c911f..3224b30 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,10 @@ GNU coreutils NEWS                                    -*- outline -*-

 ** Bug fixes

+  du --one-file-system (-x) would ignore any non-directory specified on
+  the command line.  For example, "touch f; du -x f" would print nothing.
+  [bug introduced in coreutils-8.14]
+
   mv now lets you move a symlink onto a same-inode destination file that
   has two or more hard links.  Before, it would reject that, saying that
   they are the same, implicitly warning you that the move would result in
diff --git a/THANKS.in b/THANKS.in
index c8dd75f..d23f7b3 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -134,6 +134,7 @@ Dan Hagerty                         hag <at> gnu.ai.it.edu
 Dan Pascu                           dan <at> services.iiruc.ro
 Daniel Bergstrom                    noa <at> melody.se
 Daniel P. Berrangé                  berrange <at> redhat.com
+Daniel Stavrovski                   d <at> stavrovski.net
 Dániel Varga                        danielv <at> axelero.hu
 Danny Levinson                      danny.levinson <at> overture.com
 Darrel Francis                      d.francis <at> cheerful.com
diff --git a/src/du.c b/src/du.c
index e4e36df..41c9535 100644
--- a/src/du.c
+++ b/src/du.c
@@ -443,7 +443,14 @@ process_file (FTS *fts, FTSENT *ent)
               return false;
             }

-          if (fts->fts_options & FTS_XDEV && fts->fts_dev != sb->st_dev)
+          /* The --one-file-system (-x) option cannot exclude anything
+             specified on the command-line.  By definition, it can exclude
+             a file or directory only when its device number is different
+             from that of its just-processed parent directory, and du does
+             not process the parent of a command-line argument.  */
+          if (fts->fts_options & FTS_XDEV
+              && FTS_ROOTLEVEL < ent->fts_level
+              && fts->fts_dev != sb->st_dev)
             excluded = true;
         }

diff --git a/tests/du/one-file-system b/tests/du/one-file-system
index f0d264a..110080f 100755
--- a/tests/du/one-file-system
+++ b/tests/du/one-file-system
@@ -43,7 +43,15 @@ compare exp out || fail=1
 du -xL d > u || fail=1
 sed 's/^[0-9][0-9]*	//' u > out1
 echo d > exp1 || fail=1
-
 compare exp1 out1 || fail=1

+# With coreutils-8.15, "du -xs FILE" would print no output.
+touch f
+for opt in -x -xs; do
+  du $opt f > u || fail=1
+  sed 's/^[0-9][0-9]*	//' u > out2
+  echo f > exp2 || fail=1
+  compare exp2 out2 || fail=1
+done
+
 Exit $fail
--
1.7.9.3.363.g121f0




Information forwarded to bug-coreutils <at> gnu.org:
bug#10967; Package coreutils. (Thu, 08 Mar 2012 11:07:02 GMT) Full text and rfc822 format available.

Message #14 received at 10967 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Jim Meyering <jim <at> meyering.net>
Cc: 10967 <at> debbugs.gnu.org, Daniel Stavrovski <d <at> stavrovski.net>
Subject: Re: bug#10967: Weird 'du' behavior. Bug in coreutils-8.15 ?
Date: Thu, 08 Mar 2012 11:04:38 +0000
On 03/08/2012 10:36 AM, Jim Meyering wrote:
> Jim Meyering wrote:
> ...
>>> du (GNU coreutils) 8.15
>>
>> Oh!  That's a regression.
>> Thank you for finding/reporting it!
>>
>> Here's the fix I expect to use:
>>
>> diff --git a/src/du.c b/src/du.c
>> index e4e36df..c1c0417 100644
>> --- a/src/du.c
>> +++ b/src/du.c
>> @@ -443,7 +443,9 @@ process_file (FTS *fts, FTSENT *ent)
>>                return false;
>>              }
>>
>> -          if (fts->fts_options & FTS_XDEV && fts->fts_dev != sb->st_dev)
>> +          if (fts->fts_options & FTS_XDEV
>> +              && FTS_ROOTLEVEL < ent->fts_level
>> +              && fts->fts_dev != sb->st_dev)
>>              excluded = true;
>>          }
> 
> Thanks again.
> A small reproducer is to run this:
> 
>     du -x /etc/passwd
> 
> If it prints nothing (coreutils-8.15), you have the bug.
> 
> Here is a complete patch:
> 
>>From b51e77776fbc4c8fa6727388b735427596595477 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering <at> redhat.com>
> Date: Thu, 8 Mar 2012 10:33:50 +0100
> Subject: [PATCH] du: --one-file-system (-x) ignores non-directory arguments

I find it a bit easier to parse if the summary describes
the change rather than the bug. So something like:

du: fix -x to include non-directory arguments

> Surprise!  "du -x non-DIR" would print nothing.
> Note that the problem arises only when processing a non-directory
> specified on the command line.  Not surprisingly, "du -x" still
> works as expected for any directory argument.
> 
> When performing its same-file-system check, du may skip an entry
> only if it is at fts_level 1 or greater.  Command-line arguments
> are at fts_level == 0 (FTS_ROOTLEVEL).
> 
> * src/du.c (process_file): Don't use the top-level FTS->fts_dev
> when testing for --one-file-system (-x).  It happens to be valid
> for directories, but it is always 0 for a non-directory.
> * tests/du/one-file-system: Add tests for this.
> * NEWS (Bug fixes): Mention it.
> Reported by Daniel Stavrovski in http://bugs.gnu.org/10967.
> Introduced by commit v8.14-95-gcfe1040.

While I can `git show` the above revision format,
gitk doesn't hyperlink it. Does gitweb auto link the above format?
I guess they may in future at least?

> ---
>  NEWS                     |    4 ++++
>  THANKS.in                |    1 +
>  src/du.c                 |    9 ++++++++-
>  tests/du/one-file-system |   10 +++++++++-
>  4 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/NEWS b/NEWS
> index 04c911f..3224b30 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -22,6 +22,10 @@ GNU coreutils NEWS                                    -*- outline -*-
> 
>  ** Bug fixes
> 
> +  du --one-file-system (-x) would ignore any non-directory specified on
> +  the command line.  For example, "touch f; du -x f" would print nothing.
> +  [bug introduced in coreutils-8.14]
> +
>    mv now lets you move a symlink onto a same-inode destination file that
>    has two or more hard links.  Before, it would reject that, saying that
>    they are the same, implicitly warning you that the move would result in
> diff --git a/THANKS.in b/THANKS.in
> index c8dd75f..d23f7b3 100644
> --- a/THANKS.in
> +++ b/THANKS.in
> @@ -134,6 +134,7 @@ Dan Hagerty                         hag <at> gnu.ai.it.edu
>  Dan Pascu                           dan <at> services.iiruc.ro
>  Daniel Bergstrom                    noa <at> melody.se
>  Daniel P. Berrangé                  berrange <at> redhat.com
> +Daniel Stavrovski                   d <at> stavrovski.net
>  Dániel Varga                        danielv <at> axelero.hu
>  Danny Levinson                      danny.levinson <at> overture.com
>  Darrel Francis                      d.francis <at> cheerful.com
> diff --git a/src/du.c b/src/du.c
> index e4e36df..41c9535 100644
> --- a/src/du.c
> +++ b/src/du.c
> @@ -443,7 +443,14 @@ process_file (FTS *fts, FTSENT *ent)
>                return false;
>              }
> 
> -          if (fts->fts_options & FTS_XDEV && fts->fts_dev != sb->st_dev)
> +          /* The --one-file-system (-x) option cannot exclude anything
> +             specified on the command-line.  By definition, it can exclude
> +             a file or directory only when its device number is different
> +             from that of its just-processed parent directory, and du does
> +             not process the parent of a command-line argument.  */
> +          if (fts->fts_options & FTS_XDEV
> +              && FTS_ROOTLEVEL < ent->fts_level
> +              && fts->fts_dev != sb->st_dev)
>              excluded = true;
>          }
> 
> diff --git a/tests/du/one-file-system b/tests/du/one-file-system
> index f0d264a..110080f 100755
> --- a/tests/du/one-file-system
> +++ b/tests/du/one-file-system
> @@ -43,7 +43,15 @@ compare exp out || fail=1
>  du -xL d > u || fail=1
>  sed 's/^[0-9][0-9]*	//' u > out1
>  echo d > exp1 || fail=1
> -
>  compare exp1 out1 || fail=1
> 
> +# With coreutils-8.15, "du -xs FILE" would print no output.
> +touch f
> +for opt in -x -xs; do
> +  du $opt f > u || fail=1
> +  sed 's/^[0-9][0-9]*	//' u > out2
> +  echo f > exp2 || fail=1
> +  compare exp2 out2 || fail=1

Maybe this is enough?

du $opt f | grep . > /dev/null || fail=1

cheers,
Pádraig.






Information forwarded to bug-coreutils <at> gnu.org:
bug#10967; Package coreutils. (Thu, 08 Mar 2012 11:41:02 GMT) Full text and rfc822 format available.

Message #17 received at 10967 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 10967 <at> debbugs.gnu.org, Daniel Stavrovski <d <at> stavrovski.net>
Subject: Re: bug#10967: Weird 'du' behavior. Bug in coreutils-8.15 ?
Date: Thu, 08 Mar 2012 12:39:09 +0100
Pádraig Brady wrote:
> On 03/08/2012 10:36 AM, Jim Meyering wrote:
...
>> Subject: [PATCH] du: --one-file-system (-x) ignores non-directory arguments
>
> I find it a bit easier to parse if the summary describes
> the change rather than the bug. So something like:
>
> du: fix -x to include non-directory arguments

Thanks for the quick feedback.

I see your point, but prefer not to use "include", because that
might evoke du's --exclude or --exclude-from options.
How about this?

  du: fix -x: don't ignore non-directory arguments

...
>> * src/du.c (process_file): Don't use the top-level FTS->fts_dev
>> when testing for --one-file-system (-x).  It happens to be valid
>> for directories, but it is always 0 for a non-directory.
>> * tests/du/one-file-system: Add tests for this.
>> * NEWS (Bug fixes): Mention it.
>> Reported by Daniel Stavrovski in http://bugs.gnu.org/10967.
>> Introduced by commit v8.14-95-gcfe1040.
>
> While I can `git show` the above revision format,
> gitk doesn't hyperlink it. Does gitweb auto link the above format?
> I guess they may in future at least?

I much prefer to use the version-including form, v8.14-95-gcfe1040
over the bare-SHA1 form that stock gitk currently highlights, so I
patched gitk to also highlight the more human-friendly form.
Not only is it more readable, but with the version-including form,
there is much less need to specify a commit date, title, etc. that
we have been doing.

I posted the patch, and Junio (the git maintainer) liked it
  http://marc.info/?t=132352993500001&r=1&w=2
so I think we're waiting for sign-off from the gitk maintainer,
whom I've just pinged privately.

Here's what it looks like:
  http://meyering.net/code/gitk/gitk-highlight-git-describe-SHA1.jpg

It would be nicer to highlight the entire string, but that would
have required a more invasive patch.

>> +  sed 's/^[0-9][0-9]*	//' u > out2
>> +  echo f > exp2 || fail=1
>> +  compare exp2 out2 || fail=1
>
> Maybe this is enough?
>
> du $opt f | grep . > /dev/null || fail=1

Technically that is enough to detect the bug, but it would
pass even if du were to print nonsense and exit nonzero.
Since these are the only tests that make du operate on a non-directory,
I prefer to check du's exit status and its precise output.




Information forwarded to bug-coreutils <at> gnu.org:
bug#10967; Package coreutils. (Thu, 08 Mar 2012 11:50:02 GMT) Full text and rfc822 format available.

Message #20 received at 10967 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Jim Meyering <jim <at> meyering.net>
Cc: 10967 <at> debbugs.gnu.org, Daniel Stavrovski <d <at> stavrovski.net>
Subject: Re: bug#10967: Weird 'du' behavior. Bug in coreutils-8.15 ?
Date: Thu, 08 Mar 2012 11:47:51 +0000
On 03/08/2012 11:39 AM, Jim Meyering wrote:
> Pádraig Brady wrote:
>> On 03/08/2012 10:36 AM, Jim Meyering wrote:
> ...
>>> Subject: [PATCH] du: --one-file-system (-x) ignores non-directory arguments
>>
>> I find it a bit easier to parse if the summary describes
>> the change rather than the bug. So something like:
>>
>> du: fix -x to include non-directory arguments
> 
> Thanks for the quick feedback.
> 
> I see your point, but prefer not to use "include", because that
> might evoke du's --exclude or --exclude-from options.
> How about this?
> 
>   du: fix -x: don't ignore non-directory arguments

perfect

>>> Introduced by commit v8.14-95-gcfe1040.
>>
>> While I can `git show` the above revision format,
>> gitk doesn't hyperlink it. Does gitweb auto link the above format?
>> I guess they may in future at least?
> 
> I much prefer to use the version-including form, v8.14-95-gcfe1040
> over the bare-SHA1 form that stock gitk currently highlights, so I
> patched gitk to also highlight the more human-friendly form.
> Not only is it more readable, but with the version-including form,
> there is much less need to specify a commit date, title, etc. that
> we have been doing.

I agree.

> I posted the patch, and Junio (the git maintainer) liked it
>   http://marc.info/?t=132352993500001&r=1&w=2
> so I think we're waiting for sign-off from the gitk maintainer,
> whom I've just pinged privately.

Hah cool.
Even if you hadn't been proactive enough to do this,
as long as it was technically possible I'd have been
fine to go with the improved references.

> Here's what it looks like:
>   http://meyering.net/code/gitk/gitk-highlight-git-describe-SHA1.jpg
> 
> It would be nicer to highlight the entire string, but that would
> have required a more invasive patch.
> 
>>> +  sed 's/^[0-9][0-9]*	//' u > out2
>>> +  echo f > exp2 || fail=1
>>> +  compare exp2 out2 || fail=1
>>
>> Maybe this is enough?
>>
>> du $opt f | grep . > /dev/null || fail=1
> 
> Technically that is enough to detect the bug, but it would
> pass even if du were to print nonsense and exit nonzero.
> Since these are the only tests that make du operate on a non-directory,
> I prefer to check du's exit status and its precise output.

cheers,
Pádraig




Information forwarded to bug-coreutils <at> gnu.org:
bug#10967; Package coreutils. (Fri, 09 Mar 2012 04:34:02 GMT) Full text and rfc822 format available.

Message #23 received at 10967 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Stavrovski <d <at> stavrovski.net>
To: Pádraig Brady <P <at> draigbrady.com>
Cc: 10967 <at> debbugs.gnu.org, Jim Meyering <jim <at> meyering.net>
Subject: Re: bug#10967: Weird 'du' behavior. Bug in coreutils-8.15 ?
Date: Thu, 8 Mar 2012 22:32:02 -0600
[Message part 1 (text/plain, inline)]
Thank you gurus.

Just keep up the great work.

Daniel

2012/3/8 Pádraig Brady <P <at> draigbrady.com>

> On 03/08/2012 11:39 AM, Jim Meyering wrote:
> > Pádraig Brady wrote:
> >> On 03/08/2012 10:36 AM, Jim Meyering wrote:
> > ...
> >>> Subject: [PATCH] du: --one-file-system (-x) ignores non-directory
> arguments
> >>
> >> I find it a bit easier to parse if the summary describes
> >> the change rather than the bug. So something like:
> >>
> >> du: fix -x to include non-directory arguments
> >
> > Thanks for the quick feedback.
> >
> > I see your point, but prefer not to use "include", because that
> > might evoke du's --exclude or --exclude-from options.
> > How about this?
> >
> >   du: fix -x: don't ignore non-directory arguments
>
> perfect
>
> >>> Introduced by commit v8.14-95-gcfe1040.
> >>
> >> While I can `git show` the above revision format,
> >> gitk doesn't hyperlink it. Does gitweb auto link the above format?
> >> I guess they may in future at least?
> >
> > I much prefer to use the version-including form, v8.14-95-gcfe1040
> > over the bare-SHA1 form that stock gitk currently highlights, so I
> > patched gitk to also highlight the more human-friendly form.
> > Not only is it more readable, but with the version-including form,
> > there is much less need to specify a commit date, title, etc. that
> > we have been doing.
>
> I agree.
>
> > I posted the patch, and Junio (the git maintainer) liked it
> >   http://marc.info/?t=132352993500001&r=1&w=2
> > so I think we're waiting for sign-off from the gitk maintainer,
> > whom I've just pinged privately.
>
> Hah cool.
> Even if you hadn't been proactive enough to do this,
> as long as it was technically possible I'd have been
> fine to go with the improved references.
>
> > Here's what it looks like:
> >   http://meyering.net/code/gitk/gitk-highlight-git-describe-SHA1.jpg
> >
> > It would be nicer to highlight the entire string, but that would
> > have required a more invasive patch.
> >
> >>> +  sed 's/^[0-9][0-9]*      //' u > out2
> >>> +  echo f > exp2 || fail=1
> >>> +  compare exp2 out2 || fail=1
> >>
> >> Maybe this is enough?
> >>
> >> du $opt f | grep . > /dev/null || fail=1
> >
> > Technically that is enough to detect the bug, but it would
> > pass even if du were to print nonsense and exit nonzero.
> > Since these are the only tests that make du operate on a non-directory,
> > I prefer to check du's exit status and its precise output.
>
> cheers,
> Pádraig
>



-- 

An Educated Fool
[Message part 2 (text/html, inline)]

Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Fri, 09 Mar 2012 07:23:02 GMT) Full text and rfc822 format available.

Notification sent to Daniel Stavrovski <d <at> stavrovski.net>:
bug acknowledged by developer. (Fri, 09 Mar 2012 07:23:02 GMT) Full text and rfc822 format available.

Message #28 received at 10967-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: 10967-done <at> debbugs.gnu.org
Subject: Re: bug#10967: Weird 'du' behavior. Bug in coreutils-8.15 ?
Date: Fri, 09 Mar 2012 08:21:35 +0100
Pádraig Brady wrote:
> On 03/08/2012 11:39 AM, Jim Meyering wrote:
>> Pádraig Brady wrote:
>>> On 03/08/2012 10:36 AM, Jim Meyering wrote:
>> ...
>>>> Subject: [PATCH] du: --one-file-system (-x) ignores non-directory arguments
>>>
>>> I find it a bit easier to parse if the summary describes
>>> the change rather than the bug. So something like:
>>>
>>> du: fix -x to include non-directory arguments
>>
>> Thanks for the quick feedback.
>>
>> I see your point, but prefer not to use "include", because that
>> might evoke du's --exclude or --exclude-from options.
>> How about this?
>>
>>   du: fix -x: don't ignore non-directory arguments
>
> perfect

With that, I pushed yesterday and am closing the ticket now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 06 Apr 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 22 days ago.

Previous Next


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