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

Re: [PATCH] ref-filter: sort numerically when ":size" is used

From
Jeff King <peff@peff.net>
Date
Sep 1, 2023, 20:40 UTC
Message-ID
<20230901204006.GA1960498@coredump.intra.peff.net>
In-Reply-To
<xmqqcyz1psnb.fsf@gitster.g>
On Fri, Sep 01, 2023 at 01:04:08PM -0700, Junio C Hamano wrote:
> In any case, it was very good that you noticed we do not sort
> numerically when sorting by size (I guess our sort by timestamp
> weren't affected only because we have been lucky?).  Thanks for
> starting this topic.

I think the date code works as expected, and by design. It's just that the code is a little confusing. :) Something like %(committerdate) gets a used_atom with FIELD_TIME, and the "grab" function sets v->value to the unix-epoch timestamp. And then the comparison function uses v->value, since it's not FIELD_STR.

It's a little hard to follow the code that fills in v->value, but the call stack is roughly grab_values() -> grab_person() -> grab_date().

-Peff
Previous: Junio C HamanoNext: Kousik Sanagavarapu
Message 11 of 14 in “ref-filter: sort numerically when ":size" is used”
  1. ref-filter: sort numerically when ":size" is usedKousik Sanagavarapu, Sep 1, 2023
  2. Junio C HamanoSep 1, 2023
  3. Jeff KingSep 1, 2023
  4. Junio C HamanoSep 1, 2023
  5. Jeff KingSep 1, 2023
  6. Kousik SanagavarapuSep 1, 2023
  7. Jeff KingSep 1, 2023
  8. Junio C HamanoSep 1, 2023
  9. Jeff KingSep 1, 2023
  10. Junio C HamanoSep 1, 2023
  11. Jeff KingSep 1, 2023
  12. ref-filter: sort numerically when ":size" is usedKousik Sanagavarapu, Sep 2, 2023
  13. Kousik SanagavarapuSep 2, 2023
  14. Junio C HamanoSep 2, 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.