Subject: Re: bug#6176: [PATCH 1/2] sort: add a --debug option to highlight key extents

From: Pádraig Brady <[email-masked]>
Date: Wed, 12 May 2010 12:39:01 +0100

On 12/05/10 12:08, Jim Meyering wrote:
> Pádraig Brady wrote:
>> The attached patch allows one to:
>>
>> $ printf "one 2 3e3e" | .sort --debug -k3,3g -k2,2
>> one 2 3e3e
>>       ___
>>    __
>> __________
> 
> Nice.  Thanks for writing all of that.
> These changes are sure to be useful.
> 
> I have merely glanced through them (look fine so far),
> but would not mind at all if you were to push the series as-is.
> 
> Jim
> 
> PS: I've gone ahead and marked this as "done".

Thanks.

The changes shouldn't be risky as everything
is protected with if (debug).

I was also wondering about informational class
messages that could be output by --debug.
Perhaps stats on the number of comparisons done
could be useful? Also mentioning the oft confusing
collating order with something like:

if (debug)
  {
    if (hard_LC_COLLATE)
      fprintf (stderr, _("# Using %s locale rules\n"),
               quote(setlocale (LC_COLLATE, NULL));
    else
      fprintf (stderr, _("# Using simple byte comparison\n");
  }

Anyway, something for another day.

cheers,
Pádraig.