GNU bug report logs - #23665
spaces in keys: doc, --debug in LC_ALL=C

Previous Next

Package: coreutils;

Reported by: Karl Berry <karl <at> freefriends.org>

Date: Tue, 31 May 2016 18:33:02 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Karl Berry <karl <at> freefriends.org>
Cc: 23665 <at> debbugs.gnu.org
Subject: Re: bug#23665: spaces in keys: doc, --debug in LC_ALL=C
Date: Tue, 31 May 2016 20:38:11 -0400
[Message part 1 (text/plain, inline)]
Hello Karl and all,

> On May 31, 2016, at 19:15, Karl Berry <karl <at> freefriends.org> wrote:
[...]
> I'm not sure what you mean by [...].  The %lu?
> Are you proposing to just add the word "sort"?  That's not needed IMHO.

I was suggesting exactly that :)
Also, the word "key" appears in few other messages, the attached patch adds "sort" to them all. This is of course just a suggestion, and we can use another syntax like the one you listed.

Attached are 3 patches, not finalized but good as a starting point for comments.

1. rephrase "key" with "sort key". Perhaps this is superfluous - thoughts ?

2. add a bit more verbose progress information to the 'sort-debug-warn.sh' test - just so it'll be easier to discuss to the changed messages.

3. removes the 'maybe_space_aligned' and modifies the condition a bit.

Expanding on the third patch:
In the following two tests, the "leading space" warning is now printed (the numbers refer to the numbers added in patch 2):
   #7 
   sort -gbr -k1,1n -k1,1r --debug /dev/null
   #11
   sort -k1,1r --debug /dev/null

I would say this is correct, as spaces do matter for LC_ALL=C with "-r" sorting:

    $ cat -A 1.txt 
    x  A$
    x   B$
    x C$

    $ LC_ALL=C ./src/sort -k2,2r 1.txt 
    x C
    x  A
    x   B

    $ LC_ALL=C ./src/sort -k2b,2r 1.txt 
    x C
    x   B
    x  A

The "leading space" warning is removed from the last test, because for keys that are "zero widths" and are ignored there's no point in printing the warning.


Comments welcomed,
  - assaf


[0001-sort-clearify-key-meaning-in-debug-warnings.patch (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]

[0002-tests-sort-debug-warn-add-progress-information-lines.patch (application/octet-stream, attachment)]
[Message part 5 (text/plain, inline)]

[0003-sort-modify-leading-spaces-debug-warning-scenarios.patch (application/octet-stream, attachment)]

This bug report was last modified 6 years and 245 days ago.

Previous Next


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