GNU bug report logs - #19148
ls --inode --sort=inode

Previous Next

Package: coreutils;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sat, 22 Nov 2014 00:05:01 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

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 19148 in the body.
You can then email your comments to 19148 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#19148; Package coreutils. (Sat, 22 Nov 2014 00:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 22 Nov 2014 00:05:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-coreutils <at> gnu.org
Subject: ls --inode --sort=inode
Date: Sat, 22 Nov 2014 07:57:49 +0800
$ man ls
       --sort=WORD
              sort  by  WORD instead of name: none (-U), size (-S), time (-t),
              version (-v), extension (-X)

Perhaps add new functionality: inode (-i)




Information forwarded to bug-coreutils <at> gnu.org:
bug#19148; Package coreutils. (Sat, 22 Nov 2014 00:34:02 GMT) Full text and rfc822 format available.

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

From: Eric Blake <eblake <at> redhat.com>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>,
 19148 <at> debbugs.gnu.org
Subject: Re: bug#19148: ls --inode --sort=inode
Date: Fri, 21 Nov 2014 17:33:14 -0700
[Message part 1 (text/plain, inline)]
On 11/21/2014 04:57 PM, 積丹尼 Dan Jacobson wrote:
> $ man ls
>        --sort=WORD
>               sort  by  WORD instead of name: none (-U), size (-S), time (-t),
>               version (-v), extension (-X)
> 
> Perhaps add new functionality: inode (-i)

Nice idea, especially since we've already proven that 'rm' and other
tasks run faster when it first sorts by inode internally.

To _some_ extent, you can get the behavior by doing:
  ls -iU | sort -k1,1n | sed 's/^[0-9]* //'
but since ls already is wired for sorting, it has a nice appeal to do it
all from with ls.  Also, my workaround doesn't help with ls outputs
other than single file per line, and isn't entirely robust if a filename
contains newline.

However, we CANNOT treat '--sort=inode' as equivalent to '-i', because
the existing meaning of -i does NOT affect sorting (all of the other
sort options -U, -S, -t, -v, and -X DO affect sorting, and --sort is
just a long-option-y way of spelling the same), and for back-compat
reasons, we cannot change the behavior of -i.  Also, I'm very reluctant
to burn another short-option letter for 'ls'.  Besides, since both '-i'
and '-I' are already burned, and what other good mnemonic would we even
have?

I guess it would be okay to have a long option with no short-option
counterpart; it would look a bit awkward in the help text, but we could
figure something out.

-- 
Eric Blake   eblake 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#19148; Package coreutils. (Sat, 22 Nov 2014 01:07:02 GMT) Full text and rfc822 format available.

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

From: Pádraig Brady <P <at> draigBrady.com>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>, 
 19148 <at> debbugs.gnu.org
Subject: Re: bug#19148: ls --inode --sort=inode
Date: Sat, 22 Nov 2014 01:06:03 +0000
On 21/11/14 23:57, 積丹尼 Dan Jacobson wrote:
> $ man ls
>        --sort=WORD
>               sort  by  WORD instead of name: none (-U), size (-S), time (-t),
>               version (-v), extension (-X)
> 
> Perhaps add new functionality: inode (-i)

Yes maybe, especially when combined with -R.
Do you have a specific use case to help decide on applicability.
Note `find | sort` seems more suited for low level access like this.

thanks,
Pádraig.





Information forwarded to bug-coreutils <at> gnu.org:
bug#19148; Package coreutils. (Sat, 22 Nov 2014 01:29:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Eric Blake <eblake <at> redhat.com>
Cc: 19148 <at> debbugs.gnu.org
Subject: Re: bug#19148: ls --inode --sort=inode
Date: Sat, 22 Nov 2014 09:28:38 +0800
>>>>> "EB" == Eric Blake <eblake <at> redhat.com> writes:
EB> I guess it would be okay to have a long option with no short-option
EB> counterpart; it would look a bit awkward in the help text, but we could
EB> figure something out.

I thought that is why there was a separate --sort, just for those
cases... Ah.. Oh.. OK.

Anyway Pádraig, my usage case was **secret** (so dumb as to make this
bug report INVALID, so I'm not revealing it!)




Added tag(s) notabug. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Sat, 22 Nov 2014 01:39:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 19148 <at> debbugs.gnu.org and 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Sat, 22 Nov 2014 01:39:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#19148; Package coreutils. (Sat, 22 Nov 2014 02:11:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: 19148 <at> debbugs.gnu.org
Subject: Re: bug#19148 acknowledged by developer ()
Date: Sat, 22 Nov 2014 10:10:39 +0800
I still wish this

$ ls -i --sort=inode
ls: invalid argument ‘inode’ for ‘--sort’
Valid arguments are:
  - ‘none’
  - ‘time’
  - ‘size’
  - ‘extension’
  - ‘version’
Try 'ls --help' for more information.

worked.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 20 Dec 2014 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 242 days ago.

Previous Next


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