GNU bug report logs -
#26991
ls-quotes: new quoting takes up unnecessary space
Previous Next
Reported by: L A Walsh <coreutils <at> tlinx.org>
Date: Fri, 19 May 2017 06:49:02 UTC
Severity: normal
Done: Assaf Gordon <assafgordon <at> gmail.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 26991 in the body.
You can then email your comments to 26991 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#26991
; Package
coreutils
.
(Fri, 19 May 2017 06:49:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
L A Walsh <coreutils <at> tlinx.org>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Fri, 19 May 2017 06:49:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
The new format uses extra spacing on columns where it isn't needed --
but the extra space isn't enough to handle the 1 file that was quoted
(needs 5 extra columns). Where does it get '3' (and why doesn't it use
2?)?
Here are 32 files:
> ls
aaaaaaa bbbbbbb ccccccc ddddddd eeeeeee fffffff ggggggg
hhhhhhh
aaaaaaa0 bbbbbbb0 ccccccc0 ddddddd0 eeeeeee0 fffffff0 ggggggg0
hhhhhhh0
aaaaaaa1 bbbbbbb1 ccccccc1 ddddddd1 eeeeeee1 fffffff1 ggggggg1
hhhhhhh1
aaaaaaa2 bbbbbbb2 ccccccc2 ddddddd2 eeeeeee2 fffffff2 ggggggg2
hhhhhhh2
# ^^ -- 2 chars separate
> mv aaaaaaa \"aaaa\'\" #same number of characters
> ls
'"aaaa'\''"' bbbbbbb0 ccccccc1 ddddddd2 fffffff ggggggg0
hhhhhhh1
aaaaaaa0 bbbbbbb1 ccccccc2 eeeeeee fffffff0 ggggggg1
hhhhhhh2
aaaaaaa1 bbbbbbb2 ddddddd eeeeeee0 fffffff1 ggggggg2
aaaaaaa2 ccccccc ddddddd0 eeeeeee1 fffffff2 hhhhhhh
bbbbbbb ccccccc0 ddddddd1 eeeeeee2 ggggggg hhhhhhh0
^^^ - now using minimum of 3 spaces between columns
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#26991
; Package
coreutils
.
(Fri, 19 May 2017 09:00:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 26991 <at> debbugs.gnu.org (full text, mbox):
On 19/05/17 07:48, L A Walsh wrote:
>
>
> The new format uses extra spacing on columns where it isn't needed --
> but the extra space isn't enough to handle the 1 file that was quoted
> (needs 5 extra columns). Where does it get '3' (and why doesn't it use
> 2?)?
Yes one can construct edge cases where this isn't ideal.
The normal case though is the quoted files are interspersed
in various columns. It's more important to have consistent
spacing I think on modern terminals. Anyway with layouts
like this you get more wasted space when a few files have
relatively longer names, irrespective of quoting, which is
a much more common issue.
The spacing is increased to 3 to allow for an extra space
for left alignment of non quoted items with quoted ones.
The alignment is more important for long listing I think,
but thought it a net benefit for other formats also.
Pádraig.
Information forwarded
to
bug-coreutils <at> gnu.org
:
bug#26991
; Package
coreutils
.
(Sat, 20 May 2017 00:38:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 26991 <at> debbugs.gnu.org (full text, mbox):
Pádraig Brady wrote:
> On 19/05/17 07:48, L A Walsh wrote:
>>
>> The new format uses extra spacing on columns where it isn't needed --
>> but the extra space isn't enough to handle the 1 file that was quoted
>> (needs 5 extra columns). Where does it get '3' (and why doesn't it use
>> 2?)?
>
> Yes one can construct edge cases where this isn't ideal.
> The normal case though is the quoted files are interspersed
> in various columns.
---
Like this?:
'"aaaa'\''"' bbbbbbb0 'ddd ddd1' eeeeeee0 ggggggg hhhhhhh1
'aaa aaa1' bbbbbbb2 ddddddd eeeeeee2 ggggggg0 hhhhhhh2
aaaaaaa0 'ccc ccc1' ddddddd0 fffffff ggggggg1
aaaaaaa2 ccccccc ddddddd2 fffffff0 ggggggg2
'bbb bbb1' ccccccc0 'eee eee1' fffffff1 hhhhhhh
bbbbbbb ccccccc2 eeeeeee fffffff2 hhhhhhh0
1234567 1234 1234 123 123
You have 3 different spacings between columns. Your argument
of using 3-spaces for an extra quote vs. 2 when not needed is
looking pretty unsupportable since it doesn't use 3 when quotes
ARE needed (it uses 4). The above could just as easily have been:
'"aaaa'\''"' bbbbbbb0 'ddd ddd1' eeeeeee0 ggggggg hhhhhhh1
'aaa aaa1' bbbbbbb2 ddddddd eeeeeee2 ggggggg0 hhhhhhh2
aaaaaaa0 'ccc ccc1' ddddddd0 fffffff ggggggg1
aaaaaaa2 ccccccc ddddddd2 fffffff0 ggggggg2
'bbb bbb1' ccccccc0 eeeeeee1 fffffff1 hhhhhhh
bbbbbbb ccccccc2 eeeeeee fffffff2 hhhhhhh0
And this:
'"aaa'\''"' bbbbbb cccccc0 dddddd2 ffffff gggggg0 hhhhhh1
'aaa aa1' bbbbbb0 cccccc2 'eee ee1' ffffff0 gggggg1 hhhhhh2
aaaaaa0 bbbbbb2 'ddd dd1' eeeeee ffffff1 gggggg2
aaaaaa2 'ccc cc1' dddddd eeeeee0 ffffff2 hhhhhh
'bbb bb1' cccccc dddddd0 eeeeee2 gggggg hhhhhh0
12345 123 123 123 123 123
12345678901234567890123456789012345678901234567890123456789012345678901234567890
Could have been:
'"aaa'\''"' 'bbb bb1' 'ccc cc1' dddddd1 eeeeee1 ffffff gggggg hhhhhh
'aaa aa1' bbbbb cccccc dddddd eeeeee ffffff0 gggggg0 hhhhhh0
aaaaaa0 bbbbb0 cccccc0 dddddd0 eeeeee0 ffffff1 gggggg1 hhhhhh1
aaaaaa2 bbbbb2 cccccc2 dddddd2 eeeeee2 ffffff2 gggggg2 hhhhhh2
12 12 12 12 12 12 12
12345678901234567890123456789012345678901234567890123456789012345678901234567890
> It's more important to have consistent spacing I think on modern terminals.
----
But you don't as shown above -- you simply waste an extra space using
3 columns of padding rather than 2.
> Anyway with layouts
> like this you get more wasted space when a few files have
> relatively longer names, irrespective of quoting, which is
> a much more common issue.
---
Irrelevant. You are using 3 spaces when no quoting is
needed, instead of 2, forcing an extra column into all output
regardless of name length.
>
> The spacing is increased to 3 to allow for an extra space
> for left alignment of non quoted items with quoted ones.
---
As shown above it isn't needed. I have 2 between 2 quoted items,
between a combo w/1-quoted and 1 not, and 2 between non-quoted. 2-spaces
between visible characters in all columns.
> The alignment is more important for long listing I think,
> but thought it a net benefit for other formats also.
---
For a long listing, you don't multiply the spacing
by N columns. You only have 1 column, so ANY filename w/a quote
would require an extra space for the entire (1) column to line up, but
in a long listing things are still odd looking w/the last column sticking out:
> ls -l *[ab]*
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:28 '"aaa'\''"'
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 'aaa aa1'
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 aaaaaa0
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 aaaaaa2
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 'bbb bb1'
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bbbbbb
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bbbbbb0
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bbbbbb2
---vs. non quoted format---
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:28 "aaa'"
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 aaa aa1
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 aaaaaa0
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 aaaaaa2
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bbb bb1
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bbbbbb
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bbbbbb0
-rw-rw-rw-+ 1 Bliss\law Bliss\lawgroup 0 May 18 23:27 bbbbbb2
Very simply, the new format is wasting space with no justifiable
reason.
Changed bug title to 'ls-quotes: new quoting takes up unnecessary space' from 'New quoting takes up unnecessary space'
Request was from
Assaf Gordon <assafgordon <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Mon, 29 Oct 2018 03:17:02 GMT)
Full text and
rfc822 format available.
Reply sent
to
Assaf Gordon <assafgordon <at> gmail.com>
:
You have taken responsibility.
(Thu, 13 Dec 2018 20:36:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
L A Walsh <coreutils <at> tlinx.org>
:
bug acknowledged by developer.
(Thu, 13 Dec 2018 20:36:02 GMT)
Full text and
rfc822 format available.
Message #18 received at 26991-done <at> debbugs.gnu.org (full text, mbox):
Hello,
On 2017-05-19 6:37 p.m., L A Walsh wrote:
>
>
> Pádraig Brady wrote:
>> On 19/05/17 07:48, L A Walsh wrote:
>>>
>>> The new format uses extra spacing on columns where it isn't needed --
>>> but the extra space isn't enough to handle the 1 file that was quoted
>>> (needs 5 extra columns). Where does it get '3' (and why doesn't it use
>>> 2?)?
>>
We created a summary of common issues and FAQs
regarding the quoting change in ls(1):
https://www.gnu.org/software/coreutils/quotes.html
If there is an issue that is not addressed there,
please send an email to coreutils <at> gnu.org .
regards,
- assaf
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 11 Jan 2019 12:24:10 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 107 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.