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

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

From
FÖFredrik Öberg <fredrik@bakskuru.se>
Date
Jan 10, 2023, 13:33 UTC
Message-ID
<CALDp=1GBtibTR5SvG8sOX14aODtdEJWhL_PCP1mzTLmX9V0sow@mail.gmail.com>
In-Reply-To
<CAN0heSqvqnCHPa-RQ3JuxxP7M_k1ORYOAV9aG+8EuXvB1GZukw@mail.gmail.com>

Thanks for the quick response! I've been playing with creatordate and it seems to work with with both older and newer versions of git.

I am trying to understand what I did wrong. I guess you are saying that I tried to use the field committerdate, which is not available on the tags? And that the handling of this situation has changed since git/2.23? Hence I got different results?

/Fredrik
Den tis 10 jan. 2023 kl 14:05 skrev Martin Ågren <martin.agren@gmail.com>:
Show 28 quoted lines
>
> On Tue, 10 Jan 2023 at 13:18, Jeff King <peff@peff.net> wrote:
> >
> > 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
> [...]
>
> > 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: Martin ÅgrenNext: Jeff King
Message 5 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.