From: Junio C Hamano <gitster@pobox.com>
To: Victoria Dye <vdye@github.com>
Cc: Victoria Dye via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] ref-filter.c: sort formatted dates by byte value
Date: Thu, 08 Feb 2024 22:31:53 -0800 [thread overview]
Message-ID: <xmqqeddmkv1i.fsf@gitster.g> (raw)
In-Reply-To: <5ed018da-2150-42d8-995e-59a35a2e3821@github.com> (Victoria Dye's message of "Thu, 8 Feb 2024 18:46:50 -0800")
Victoria Dye <vdye@github.com> writes:
> Junio C Hamano wrote:
>>> I came across a use case for 'git for-each-ref' at $DAYJOB in which I'd
>>> want to sort by a portion of a formatted 'creatordate' (e.g., only the
>>> time of day, sans date). When I tried to run something like 'git
>>> for-each-ref --sort=creatordate:format:%H:%M:%S',
>>
>> Hmph, this indeed is interesting ;-)
>>
>> I wonder if there are other "sort by numeric but the thing could be
>> stringified by the end-user" atoms offered by for-each-ref
>> machinery. IOW, is the timestamp the only thing that needs this
>> fix?
>
> The only non-FIELD_STR atoms other than the date ones are "objectsize" and
> "numparent". "objectsize" has an optional ":disk" modifier, but that doesn't
> change formatting (just the value of the integer printed). "numparent"
> doesn't have any modifiers, it just prints the integer number of parents.
> Otherwise, everything is sorted by string value, so I think only the date
> atoms have this kind of mismatch between formatted value and sort value.
Thanks.
prev parent reply other threads:[~2024-02-09 6:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-08 1:57 [PATCH] ref-filter.c: sort formatted dates by byte value Victoria Dye via GitGitGadget
2024-02-08 3:11 ` Junio C Hamano
2024-02-09 2:46 ` Victoria Dye
2024-02-09 6:31 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqeddmkv1i.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=vdye@github.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox