GNU bug report logs - #22057
Sort missing feature proposed

Previous Next

Package: coreutils;

Reported by: Saint Michael <venefax <at> gmail.com>

Date: Sun, 29 Nov 2015 21:34:02 UTC

Severity: wishlist

Tags: wontfix

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 22057 in the body.
You can then email your comments to 22057 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#22057; Package coreutils. (Sun, 29 Nov 2015 21:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Saint Michael <venefax <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 29 Nov 2015 21:34:02 GMT) Full text and rfc822 format available.

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

From: Saint Michael <venefax <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Sort missing feature proposed
Date: Sun, 29 Nov 2015 16:33:31 -0500
[Message part 1 (text/plain, inline)]
Dear GNU
I suggest that we add a new flag to Sort, to skip certain number of lines
from the sorting and copy them verbatim to the output,

for example

cat temp
10
8
1
2
3
4
5
> sort -z2 temp
10
8
5
4
3
2
1

In this example, the parameter "z" tell the app to ignore first two lines
and copy them as is.
naturally this can be done with a combination of Sort and Head, but it is
obvious it should be part of the tool.
Federico AlvesS
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#22057; Package coreutils. (Sun, 29 Nov 2015 22:45:01 GMT) Full text and rfc822 format available.

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

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Saint Michael <venefax <at> gmail.com>, 22057 <at> debbugs.gnu.org
Subject: Re: bug#22057: Sort missing feature proposed
Date: Sun, 29 Nov 2015 17:44:42 -0500
tag 22057 notabug
close 22057
stop

Hello Federico,

On 11/29/2015 04:33 PM, Saint Michael wrote:
> I suggest that we add a new flag to Sort, to skip certain number of lines from the sorting and copy them verbatim to the output,
>

This feature has been previously discussed, and the current thought is not to add this functionality to sort,
as a combination of head/sed with sort are already sufficient to perform the task.

Please see discussion at the current list of pendong Coreutils items:
  http://www.pixelbeat.org/patches/coreutils/inbox_dec_2014.html
previous discussion here:
  http://lists.gnu.org/archive/html/coreutils/2014-11/msg00022.html
and various examples of how to achieve the same using sed/head:
  http://lists.gnu.org/archive/html/coreutils/2013-01/msg00034.html

regards,
 - assaf






Information forwarded to bug-coreutils <at> gnu.org:
bug#22057; Package coreutils. (Mon, 30 Nov 2015 14:55:02 GMT) Full text and rfc822 format available.

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

From: Pádraig Brady <P <at> draigBrady.com>
To: Assaf Gordon <assafgordon <at> gmail.com>, Saint Michael <venefax <at> gmail.com>,
 22057 <at> debbugs.gnu.org
Subject: Re: bug#22057: Sort missing feature proposed
Date: Mon, 30 Nov 2015 14:54:13 +0000
On 29/11/15 22:44, Assaf Gordon wrote:
> tag 22057 notabug
> close 22057
> stop
> 
> Hello Federico,
> 
> On 11/29/2015 04:33 PM, Saint Michael wrote:
>> I suggest that we add a new flag to Sort, to skip certain number of lines from the sorting and copy them verbatim to the output,
>>
> 
> This feature has been previously discussed, and the current thought is not to add this functionality to sort,
> as a combination of head/sed with sort are already sufficient to perform the task.
> 
> Please see discussion at the current list of pendong Coreutils items:
>    http://www.pixelbeat.org/patches/coreutils/inbox_dec_2014.html

BTW upon publishing each of those summaries, this page is updated:
http://www.gnu.org/software/coreutils/rejected_requests.html#sort

cheers,
Pádraig




Information forwarded to bug-coreutils <at> gnu.org:
bug#22057; Package coreutils. (Mon, 30 Nov 2015 17:47:01 GMT) Full text and rfc822 format available.

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

From: Saint Michael <venefax <at> gmail.com>
To: Pádraig Brady <P <at> draigbrady.com>
Cc: Assaf Gordon <assafgordon <at> gmail.com>, 22057 <at> debbugs.gnu.org
Subject: Re: bug#22057: Sort missing feature proposed
Date: Mon, 30 Nov 2015 12:46:57 -0500
[Message part 1 (text/plain, inline)]
I think that we should go ahead and include the option, since many people
find it very useful and sort of obvious. It makes no difference that the
same effect can be achieved with "sed -u 1q" and sort, since this
workaround it is far common common knowledge. This issue will keep
resurfacing  for the next 100 years, until it gets done, why don't we just
go ahead and do it?


On Mon, Nov 30, 2015 at 9:54 AM, Pádraig Brady <P <at> draigbrady.com> wrote:

> On 29/11/15 22:44, Assaf Gordon wrote:
> > tag 22057 notabug
> > close 22057
> > stop
> >
> > Hello Federico,
> >
> > On 11/29/2015 04:33 PM, Saint Michael wrote:
> >> I suggest that we add a new flag to Sort, to skip certain number of
> lines from the sorting and copy them verbatim to the output,
> >>
> >
> > This feature has been previously discussed, and the current thought is
> not to add this functionality to sort,
> > as a combination of head/sed with sort are already sufficient to perform
> the task.
> >
> > Please see discussion at the current list of pendong Coreutils items:
> >    http://www.pixelbeat.org/patches/coreutils/inbox_dec_2014.html
>
> BTW upon publishing each of those summaries, this page is updated:
> http://www.gnu.org/software/coreutils/rejected_requests.html#sort
>
> cheers,
> Pádraig
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#22057; Package coreutils. (Mon, 30 Nov 2015 20:04:02 GMT) Full text and rfc822 format available.

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

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Saint Michael <venefax <at> gmail.com>, Pádraig Brady
 <P <at> draigbrady.com>
Cc: Assaf Gordon <assafgordon <at> gmail.com>, 22057 <at> debbugs.gnu.org
Subject: Re: bug#22057: Sort missing feature proposed
Date: Mon, 30 Nov 2015 21:03:34 +0100
On 11/30/2015 06:46 PM, Saint Michael wrote:
> why don't we just go ahead and do it?

not everything which can be done makes sense to do, and even
less if the functionality is already there.

Comparison: someone is always going to his favourite Italian
restaurant for its tasty pizza and pasta.  Someone else tells
the cook "hey, you got a nice kitchen - why don't you also make
steaks?".  And then the restaurant has steaks, and burgers, and
a lot more, too.
Yes, there is nothing wrong until now, but then the first person
comes back ... and has to wonder why the great pizza and the
fabulous pasta do taste like old shoes.

Thus said, we are of course not opposed to improve things in
coreutils, but we hate to potentially make things worse for
the other users - even in future.

The problem is, the restaurant from the example above can easily
decide to go back and print a new menue just the other day with
all the superb dishes - while we have to care about compatibility.

Have a nice day,
Berny




Information forwarded to bug-coreutils <at> gnu.org:
bug#22057; Package coreutils. (Tue, 01 Dec 2015 02:17:01 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#22057: Sort missing feature proposed
Date: Mon, 30 Nov 2015 18:15:38 -0800
Saint Michael wrote:
> This issue will keep
> resurfacing  for the next 100 years

No, no, let's be optimistic!  Let's shoot for 10,000 years.





Information forwarded to bug-coreutils <at> gnu.org:
bug#22057; Package coreutils. (Tue, 01 Dec 2015 14:41:02 GMT) Full text and rfc822 format available.

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

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Saint Michael <venefax <at> gmail.com>
Cc: 22057 <at> debbugs.gnu.org, Pádraig Brady <P <at> draigbrady.com>,
 Bernhard Voelker <mail <at> bernhard-voelker.de>
Subject: Re: bug#22057: Sort missing feature proposed
Date: Tue, 1 Dec 2015 09:39:45 -0500
Hello,

> On Nov 30, 2015, at 15:03, Bernhard Voelker <mail <at> bernhard-voelker.de> wrote:
> 
> On 11/30/2015 06:46 PM, Saint Michael wrote:
>> why don't we just go ahead and do it?
> 
> not everything which can be done makes sense to do, and even
> less if the functionality is already there.

Continuing Bernhard's point,
just "going ahead and doing it" is easier said than done - at 141KB of C code, "sort.c" is a complicated program. There are many edge-cases that need to be handled properly, and several non-trivial usage cases.

That being said, a working high-quality patch is worth a thousands words, and if you (or others) implement such a feature, it will make a stronger case for inclusion.

If you do intend to pursue this course, here are some pointers:

This is a sort source code:
  http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/sort.c
Or in a slightly more informative source-code viewer:
  http://lingrok.org/xref/coreutils/src/sort.c

There have been few past attempts at such patches (myself included):
 http://lists.gnu.org/archive/html/coreutils/2010-11/msg00078.html
 http://lists.gnu.org/archive/html/coreutils/2010-11/msg00085.html
 http://lists.gnu.org/archive/html/coreutils/2013-01/msg00027.html

A different approach is writing wrapper-scripts adding the "--header" option
(disclaimer: this one is mine, but there are many other variations out there):
  https://github.com/agordon/bin_scripts/blob/master/scripts/sort-header.in

regards,
 - assaf







Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 24 Oct 2018 21:30:02 GMT) Full text and rfc822 format available.

Added tag(s) wontfix. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 24 Oct 2018 21:30:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 22057 <at> debbugs.gnu.org and Saint Michael <venefax <at> gmail.com> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 24 Oct 2018 21:30:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 22 Nov 2018 12:24:09 GMT) Full text and rfc822 format available.

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

Previous Next


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