git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: for-each-ref output order change in 2.7.0

From
Johannes Sixt <j6t@kdbg.org>
Date
Jan 10, 2016, 09:51 UTC
Message-ID
<569229B8.9000009@kdbg.org>
In-Reply-To
<CAOLa=ZTUcmAjpC4nf_o7ZAHC3Asj9iwfKOOrJr90_kAyMbd22A@mail.gmail.com>
Am 09.01.2016 um 22:29 schrieb Karthik Nayak:
Show 6 quoted lines
> On Sat, Jan 9, 2016 at 11:30 PM, Johannes Sixt <j6t@kdbg.org> wrote:
>> Am 09.01.2016 um 18:21 schrieb Karthik Nayak:
>>>>>
>>>>> (Note: The alphabetical-ness of the branch names is reversed, which
>>>>> seems logical given my original sort was -committerdate. A
>>>>> --sort=refname looks like this.

After reading up on branch sorting, I notice that the single dash in front of committerdate is not a typo, but a request to sort in reverse. Therefore, the resulting sort order, which was

refs/heads/!@#% -> Tue Jan 3 17:04:06 2012 +1100 refs/heads/@#% -> Tue Jan 3 17:00:51 2012 +1100 refs/heads/@#$% -> Tue Jan 3 17:00:51 2012 +1100 refs/heads/% -> Tue Jan 3 17:00:51 2012 +1100 refs/heads/!@#$% -> Tue Jan 3 17:00:51 2012 +1100

is totally correct.
Show 8 quoted lines
>>>>>
>>>>> refs/heads/!@#$% -> Tue Jan 3 17:00:51 2012 +1100
>>>>> refs/heads/!@#% -> Tue Jan 3 17:04:06 2012 +1100
>>>>> refs/heads/% -> Tue Jan 3 17:00:51 2012 +1100
>>>>> refs/heads/@#$% - >Tue Jan 3 17:00:51 2012 +1100
>>>>> refs/heads/@#% -> Tue Jan 3 17:00:51 2012 +1100
>>>>>
>>>>> That's probably more correct too.)
But I don't know what would be "more" correct here. It's simply correct.
Show 9 quoted lines
>>> This is correct as per the patch, But I'm wondering if this is desired.
>>> I.E when sorting in reverse order should the fallback (alphabetical sort)
>>> also be in reverse order?
>>
>>
>> IMO, the fallback sorting should be in reverse order only when the user
>> explicitley asked for reverse order. Just because committer date implies
>> some "reverse" ordering should not imply that refs with the same committer
>> date should also be listed in reverse alphabetical order.

I was wrong here. Sorting by committerdate does not imply reverse-ness. I just did not know enough about the --sort options when I wrote this paragraph.

>
> I was thinking along the same lines. But do we want to expose the fallback to
> the user (i.e let them choose if its reversible or not)?

No, we do not want to expose the fallback to the user. And as far as I can see, no further change is required.

-- Hannes
Previous: Karthik Nayak
Message 6 of 6 in “for-each-ref output order change in 2.7.0”
  1. Bryan TurnerJan 9, 2016
  2. Matthieu MoyJan 9, 2016
  3. Karthik NayakJan 9, 2016
  4. Johannes SixtJan 9, 2016
  5. Karthik NayakJan 9, 2016
  6. Johannes SixtJan 10, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.