GNU bug report logs -
#11858
df -m undocumented, why no df -g
Previous Next
Reported by: Andreas Jaeger <aj <at> suse.com>
Date: Wed, 4 Jul 2012 18:43: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 11858 in the body.
You can then email your comments to 11858 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-coreutils <at> gnu.org
:
bug#11858
; Package
coreutils
.
(Wed, 04 Jul 2012 18:43:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Andreas Jaeger <aj <at> suse.com>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Wed, 04 Jul 2012 18:43:06 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
df -k and df -m both work but only df -k is mentioned as part of df --
help. So, the omission to document -m is IMO a bug.
A second issue:
Since df supports -k and -m, shouldn't if support -g (as synoym for --
block-size=1M as well?
Btw. df --version outputs:
df (GNU coreutils) 8.16
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#11858
; Package
coreutils
.
(Wed, 04 Jul 2012 19:44:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 11858 <at> debbugs.gnu.org (full text, mbox):
On 07/04/2012 01:11 AM, Andreas Jaeger wrote:
> df -k and df -m both work but only df -k is mentioned as part of df --
> help. So, the omission to document -m is IMO a bug.
I think the general idea is that -k was a mistake, but
it's standardized, and that we don't want to have
options -m, -g, -t, -p, -e, -z, -y for the other sizes
(among other things -t is already taken). -m is there
only for BSD compatibility but we don't want to publicize
it and we may want to take it back at some point.
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#11858
; Package
coreutils
.
(Thu, 05 Jul 2012 06:54:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 11858 <at> debbugs.gnu.org (full text, mbox):
On 07/04/2012 09:38 PM, Paul Eggert wrote:
> On 07/04/2012 01:11 AM, Andreas Jaeger wrote:
>> df -k and df -m both work but only df -k is mentioned as part of df --
>> help. So, the omission to document -m is IMO a bug.
>
> I think the general idea is that -k was a mistake, but
> it's standardized, and that we don't want to have
> options -m, -g, -t, -p, -e, -z, -y for the other sizes
> (among other things -t is already taken). -m is there
> only for BSD compatibility but we don't want to publicize
> it and we may want to take it back at some point.
Wouldn't it then be consequent to remove the long option --megabyte?
(It's sister --kilobyte has been removed by v6.9-151-g1e07a21
in 2007.)
Have a nice day,
Berny
From 664bf8a103585915896f3be9f3a01f11ce17ddc6 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail <at> bernhard-voelker.de>
Date: Thu, 5 Jul 2012 08:44:22 +0200
Subject: [PATCH] df: Remove long-obsolescent --megabyte option.
* src/df.c (long_options): Remove --megabyte option.
---
src/df.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/src/df.c b/src/df.c
index e99fedf..8520424 100644
--- a/src/df.c
+++ b/src/df.c
@@ -178,7 +178,6 @@ static struct option const long_options[] =
{"human-readable", no_argument, NULL, 'h'},
{"si", no_argument, NULL, 'H'},
{"local", no_argument, NULL, 'l'},
- {"megabytes", no_argument, NULL, 'm'}, /* obsolescent */
{"portability", no_argument, NULL, 'P'},
{"print-type", no_argument, NULL, 'T'},
{"sync", no_argument, NULL, SYNC_OPTION},
--
1.7.7
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#11858
; Package
coreutils
.
(Thu, 05 Jul 2012 07:12:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 11858 <at> debbugs.gnu.org (full text, mbox):
On 07/04/2012 11:48 PM, Bernhard Voelker wrote:
> Wouldn't it then be consequent to remove the long option --megabyte?
Yes, that does make sense.
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#11858
; Package
coreutils
.
(Thu, 05 Jul 2012 11:27:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 11858 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 07/05/2012 12:48 AM, Bernhard Voelker wrote:
>> I think the general idea is that -k was a mistake, but
>> it's standardized, and that we don't want to have
>> options -m, -g, -t, -p, -e, -z, -y for the other sizes
>> (among other things -t is already taken). -m is there
>> only for BSD compatibility but we don't want to publicize
>> it and we may want to take it back at some point.
>
> Wouldn't it then be consequent to remove the long option --megabyte?
> (It's sister --kilobyte has been removed by v6.9-151-g1e07a21
> in 2007.)
In fact, the reason we removed --kilobyte was that it is a misnomer; -k
works on kibibytes, not kilobytes. Similarly, -m works on mebibytes,
not megabytes. So whether or not we keep -m but leave it undocumented,
removing the long form --megabyte makes complete sense.
>
>>From 664bf8a103585915896f3be9f3a01f11ce17ddc6 Mon Sep 17 00:00:00 2001
> From: Bernhard Voelker <mail <at> bernhard-voelker.de>
> Date: Thu, 5 Jul 2012 08:44:22 +0200
> Subject: [PATCH] df: Remove long-obsolescent --megabyte option.
>
> * src/df.c (long_options): Remove --megabyte option.
I like this patch, but I'll let Jim decide whether to apply it.
--
Eric Blake eblake <at> redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#11858
; Package
coreutils
.
(Thu, 05 Jul 2012 12:41:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 11858 <at> debbugs.gnu.org (full text, mbox):
Bernhard Voelker wrote:
> On 07/04/2012 09:38 PM, Paul Eggert wrote:
>> On 07/04/2012 01:11 AM, Andreas Jaeger wrote:
>>> df -k and df -m both work but only df -k is mentioned as part of df --
>>> help. So, the omission to document -m is IMO a bug.
>>
>> I think the general idea is that -k was a mistake, but
>> it's standardized, and that we don't want to have
>> options -m, -g, -t, -p, -e, -z, -y for the other sizes
>> (among other things -t is already taken). -m is there
>> only for BSD compatibility but we don't want to publicize
>> it and we may want to take it back at some point.
>
> Wouldn't it then be consequent to remove the long option --megabyte?
> (It's sister --kilobyte has been removed by v6.9-151-g1e07a21
> in 2007.)
...
> Subject: [PATCH] df: Remove long-obsolescent --megabyte option.
>
> * src/df.c (long_options): Remove --megabyte option.
> ---
> src/df.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/src/df.c b/src/df.c
> index e99fedf..8520424 100644
> --- a/src/df.c
> +++ b/src/df.c
> @@ -178,7 +178,6 @@ static struct option const long_options[] =
> {"human-readable", no_argument, NULL, 'h'},
> {"si", no_argument, NULL, 'H'},
> {"local", no_argument, NULL, 'l'},
> - {"megabytes", no_argument, NULL, 'm'}, /* obsolescent */
> {"portability", no_argument, NULL, 'P'},
> {"print-type", no_argument, NULL, 'T'},
> {"sync", no_argument, NULL, SYNC_OPTION},
Hi Berny,
I like the idea, but wonder if an abrupt removal would break old scripts.
For du, we made its --megabytes option issue a warning first, and removed
it altogether a year or two later.
However, I'm tempted to remove it directly this time, since it's been
undocumented for a while:
5 years in df.1 and df --help: COREUTILS-6_9-151-g1e07a21
11 years in coreutils.texi: FILEUTILS-4_1_4-28-gf5bf6fe
What do you think?
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#11858
; Package
coreutils
.
(Thu, 05 Jul 2012 14:50:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 11858 <at> debbugs.gnu.org (full text, mbox):
On 07/05/2012 02:35 PM, Jim Meyering wrote:
> However, I'm tempted to remove it directly this time, since it's been
> undocumented for a while:
>
> 5 years in df.1 and df --help: COREUTILS-6_9-151-g1e07a21
> 11 years in coreutils.texi: FILEUTILS-4_1_4-28-gf5bf6fe
>
> What do you think?
I agree, the option has been added to df in 1996, and declared
obsolescent in 2001, so the period since the latter is twice as
long as the active use.
And it's very easy to s/--megabytes/-BM/ ...
Have a nice day,
Berny
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#11858
; Package
coreutils
.
(Thu, 05 Jul 2012 15:14:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 11858 <at> debbugs.gnu.org (full text, mbox):
Bernhard Voelker wrote:
> On 07/05/2012 02:35 PM, Jim Meyering wrote:
>> However, I'm tempted to remove it directly this time, since it's been
>> undocumented for a while:
>>
>> 5 years in df.1 and df --help: COREUTILS-6_9-151-g1e07a21
>> 11 years in coreutils.texi: FILEUTILS-4_1_4-28-gf5bf6fe
>>
>> What do you think?
>
> I agree, the option has been added to df in 1996, and declared
> obsolescent in 2001, so the period since the latter is twice as
> long as the active use.
>
> And it's very easy to s/--megabytes/-BM/ ...
More important than 2001 is the year in which we removed
the reference from the man page and from --help: 2007
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#11858
; Package
coreutils
.
(Wed, 11 Jul 2012 15:42:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 11858 <at> debbugs.gnu.org (full text, mbox):
On 07/05/2012 05:08 PM, Jim Meyering wrote:
> Bernhard Voelker wrote:
>> On 07/05/2012 02:35 PM, Jim Meyering wrote:
>>> However, I'm tempted to remove it directly this time, since it's been
>>> undocumented for a while:
>>>
>>> 5 years in df.1 and df --help: COREUTILS-6_9-151-g1e07a21
>>> 11 years in coreutils.texi: FILEUTILS-4_1_4-28-gf5bf6fe
>>>
>>> What do you think?
>>
>> I agree, the option has been added to df in 1996, and declared
>> obsolescent in 2001, so the period since the latter is twice as
>> long as the active use.
>>
>> And it's very easy to s/--megabytes/-BM/ ...
>
> More important than 2001 is the year in which we removed
> the reference from the man page and from --help: 2007
You're right. Then what about a deprecation warning and removing
the long option in 2013?
P.S. Make "syntax-check" doesn't find the offender against
sc_error_message_uppercase for the "Warning:" message when
(mount_list == NULL) in df.c
Have a nice day,
Berny
From 750cd181cf87160b11556f92bd098ba535780ffc Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail <at> bernhard-voelker.de>
Date: Wed, 11 Jul 2012 17:27:20 +0200
Subject: [PATCH] df: Warn if soon-to-be-removed --megabyte option is used
* src/df.c: MEGABYTES_OPTION: Add new enum and mark it to be removed
in August 2013.
* src/df.c (long_options): Use MEGABYTES_OPTION for --megabytes option.
* src/df.c (main): Add case for MEGABYTES_OPTION and issue a deprecation
warning if the long form is being used. Document the short -m option to
exist only for BSD compatibility.
---
src/df.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/df.c b/src/df.c
index e99fedf..7e30d57 100644
--- a/src/df.c
+++ b/src/df.c
@@ -167,7 +167,8 @@ static size_t nrows;
enum
{
NO_SYNC_OPTION = CHAR_MAX + 1,
- SYNC_OPTION
+ SYNC_OPTION,
+ MEGABYTES_OPTION /* FIXME: remove long opt in Aug 2013 */
};
static struct option const long_options[] =
@@ -178,7 +179,7 @@ static struct option const long_options[] =
{"human-readable", no_argument, NULL, 'h'},
{"si", no_argument, NULL, 'H'},
{"local", no_argument, NULL, 'l'},
- {"megabytes", no_argument, NULL, 'm'}, /* obsolescent */
+ {"megabytes", no_argument, NULL, MEGABYTES_OPTION}, /* obsolescent, */
{"portability", no_argument, NULL, 'P'},
{"print-type", no_argument, NULL, 'T'},
{"sync", no_argument, NULL, SYNC_OPTION},
@@ -951,7 +952,14 @@ main (int argc, char **argv)
case 'l':
show_local_fs = true;
break;
- case 'm': /* obsolescent */
+ case MEGABYTES_OPTION:
+ /* Distinguish between the long and the short option.
+ As we want to remove the long option soon,
+ give a warning when the long form is used. */
+ error (0, 0, "%s%s", _("warning: "),
+ _("long option '--megabytes' is deprecated"
+ " and will soon be removed"));
+ case 'm': /* obsolescent, exists for BSD compatibility */
human_output_opts = 0;
output_block_size = 1024 * 1024;
break;
--
1.7.7
Reply sent
to
Jim Meyering <jim <at> meyering.net>
:
You have taken responsibility.
(Wed, 11 Jul 2012 15:56:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Andreas Jaeger <aj <at> suse.com>
:
bug acknowledged by developer.
(Wed, 11 Jul 2012 15:56:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 11858-done <at> debbugs.gnu.org (full text, mbox):
Bernhard Voelker wrote:
> Subject: [PATCH] df: Warn if soon-to-be-removed --megabyte option is used
>
> * src/df.c: MEGABYTES_OPTION: Add new enum and mark it to be removed
> in August 2013.
> * src/df.c (long_options): Use MEGABYTES_OPTION for --megabytes option.
> * src/df.c (main): Add case for MEGABYTES_OPTION and issue a deprecation
> warning if the long form is being used. Document the short -m option to
> exist only for BSD compatibility.
Thanks. Applied with log tweaks (e.g., s/W/w/ in summary, removed
each "* src/df.c" after the first -- "*" introduces a new file).
From 5e78bbd163dbc739e168fc2bff6273a2b6e5e5de Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail <at> bernhard-voelker.de>
Date: Wed, 11 Jul 2012 17:27:20 +0200
Subject: [PATCH] df: warn if soon-to-be-removed --megabyte option is used
* src/df.c (MEGABYTES_OPTION): Add enum and mark it for removal
in August 2013.
(long_options): Use MEGABYTES_OPTION for --megabytes option.
(main): Add a case for it and issue a deprecation warning if
the long form is used. Document the short -m option to
exist only for BSD compatibility.
---
src/df.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/df.c b/src/df.c
index e99fedf..7e30d57 100644
--- a/src/df.c
+++ b/src/df.c
@@ -167,7 +167,8 @@ static size_t nrows;
enum
{
NO_SYNC_OPTION = CHAR_MAX + 1,
- SYNC_OPTION
+ SYNC_OPTION,
+ MEGABYTES_OPTION /* FIXME: remove long opt in Aug 2013 */
};
static struct option const long_options[] =
@@ -178,7 +179,7 @@ static struct option const long_options[] =
{"human-readable", no_argument, NULL, 'h'},
{"si", no_argument, NULL, 'H'},
{"local", no_argument, NULL, 'l'},
- {"megabytes", no_argument, NULL, 'm'}, /* obsolescent */
+ {"megabytes", no_argument, NULL, MEGABYTES_OPTION}, /* obsolescent, */
{"portability", no_argument, NULL, 'P'},
{"print-type", no_argument, NULL, 'T'},
{"sync", no_argument, NULL, SYNC_OPTION},
@@ -951,7 +952,14 @@ main (int argc, char **argv)
case 'l':
show_local_fs = true;
break;
- case 'm': /* obsolescent */
+ case MEGABYTES_OPTION:
+ /* Distinguish between the long and the short option.
+ As we want to remove the long option soon,
+ give a warning when the long form is used. */
+ error (0, 0, "%s%s", _("warning: "),
+ _("long option '--megabytes' is deprecated"
+ " and will soon be removed"));
+ case 'm': /* obsolescent, exists for BSD compatibility */
human_output_opts = 0;
output_block_size = 1024 * 1024;
break;
--
1.7.11.1.165.g299666c
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 09 Aug 2012 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 13 years and 10 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.