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

Re: Bugreport: Prefix - is ignored when sorting (on committerdate)

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Jan 10, 2023, 13:05 UTC
Message-ID
<CAN0heSqvqnCHPa-RQ3JuxxP7M_k1ORYOAV9aG+8EuXvB1GZukw@mail.gmail.com>
In-Reply-To
<Y71Xnx2vmznV913I@coredump.intra.peff.net>
On Tue, 10 Jan 2023 at 13:18, Jeff King <peff@peff.net> wrote:
Show 13 quoted lines
>
> On Tue, Jan 10, 2023 at 11:54:16AM +0100, Martin Ågren wrote:
>
> > I suppose it could be argued that the '-' should be applied to the
> > fallback as well, e.g., to uphold some sort of "using '-' should give
> > the same result as piping the whole thing through tac" (i.e., respecting
> > `s->reverse` in `compare_refs()`, if you're following along in
> > 7c5045fc18). With multiple sort keys, some with '-' and some
> > without, we'd grab the '-' from the first key. It seems like that could
> > make sense, actually.
>
> I dunno. Just because you are reverse-sorting on one field doesn't
> necessarily imply that you want the tie-breaker to reverse-sort, too. I
[...]
Show 7 quoted lines
> I could see it depending on exactly what you're trying to do. Which
> leads me to think the rule should be as simple as possible. You can
> always do:
>
>   git for-each-ref --sort=-refname --sort=-committerdate
>
> to specify exactly what you want.
Indeed. So probably best to leave it as-is, then.
Martin
Previous: Jeff KingNext: Fredrik Öberg
Message 4 of 6 in “Bugreport: Prefix - is ignored when sorting (on committerdate)”
  1. Fredrik ÖbergJan 10, 2023
  2. Martin ÅgrenJan 10, 2023
  3. Jeff KingJan 10, 2023
  4. Martin ÅgrenJan 10, 2023
  5. Fredrik ÖbergJan 10, 2023
  6. Jeff KingJan 10, 2023

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.