Re: [PATCH] ls-remote: create option to sort by versions
- From
Jeff King <peff@peff.net>
- Date
- Apr 2, 2018, 17:46 UTC
- Message-ID
- <20180402174614.GA28566@sigill.intra.peff.net>
- In-Reply-To
- <CAHwyqnV1BwsaHVsh0xSx3MroNoJRT7UYrqF_WFKhkZMf-X9Evg@mail.gmail.com>
On Mon, Apr 02, 2018 at 06:26:49PM +0200, Harald Nordgren wrote:
Show 9 quoted lines
> It would be nice to have a uniform option like > '--sort=version:refname'. But spending a few hours to look over the > code, it seems that ls-remote.c would require a lot of rewrites if we > wanted to start using `ref_array` and `ref_array_item` for storing the > refs. > > Which seems necessary in order to hook in to the sorting flow used in > other subcommands. That, or reimplement `cmp_ref_sorting`. But maybe > I'm missing something?
I haven't looked at how painful it might be to use ref-filter.c, but it would buy us even more if we could. That would open up other options like --format, I think (OTOH there may be some funny corner cases; that code assumes we're talking about local refs, so if you were to ask for "%(committerdate)" or something, we might have to more cleanly handle the case where we don't actually have the object).
-Peff