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