help-debbugs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#19148: ls --inode --sort=inode


From: Eric Blake
Subject: Re: bug#19148: ls --inode --sort=inode
Date: Fri, 21 Nov 2014 19:25:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

[moving to help-debbugs]

On 11/21/2014 06:06 PM, Pádraig Brady wrote:
> 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.

Uggh. It seems like mail from me is NOT reaching the GNU mailing lists.
 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19148 shows that I clearly
replied to this bug, but
https://lists.gnu.org/archive/html/bug-coreutils/2014-11/index.html
shows only your reply, which came long after mine.  Could it be because
I am GPG-signing my emails, and mailman is eating mails with gpg
signatures?  If so, that is a recently relative event, because I haven't
changed anything on my end.  I'm wondering if the recent changes to turn
on https for debbugs and mailman is causing not just mine, but anyone
else sending signed mail, to get their messages eaten.

For reference, I'm attaching the mail that I sent, as it appears on my
end before reaching debbugs.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
--- Begin Message --- Subject: Re: bug#19148: ls --inode --sort=inode Date: Fri, 21 Nov 2014 17:33:14 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
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

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]