Re: [PATCH] ls-remote: create option to sort by versions

2018-04-02 Thread Harald Nordgren
Thanks for all the discussion! I think I figured out a way to reuse more ref-filter.c machinery. I will submit another patchset shortly. On Mon, Apr 2, 2018 at 8:32 PM, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > >> This is a sensible thing to want, but why not follow the UI we ha

Re: [PATCH] ls-remote: create option to sort by versions

2018-04-02 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > This is a sensible thing to want, but why not follow the UI we have for > this with git-tag? I.e. --sort= & -i (or --ignore-case)? Of course > ls-remote doesn't just show tags, so maybe we'd want --tag-sort= > and --ignore-tag-case or something, but the rest shou

Re: [PATCH] ls-remote: create option to sort by versions

2018-04-02 Thread Jeff King
On Mon, Apr 02, 2018 at 06:26:49PM +0200, Harald Nordgren wrote: > 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 `r

Re: [PATCH] ls-remote: create option to sort by versions

2018-04-02 Thread Harald Nordgren
Both points make sense and it sounds like a very pragmatic approach. I'll look into it! On Mon, Apr 2, 2018 at 7:32 PM, Ævar Arnfjörð Bjarmason wrote: > > On Mon, Apr 02 2018, Harald Nordgren wrote: > >> In regards the the print statement, it was only moved down according >> to the diff because I

Re: [PATCH] ls-remote: create option to sort by versions

2018-04-02 Thread Ævar Arnfjörð Bjarmason
On Mon, Apr 02 2018, Harald Nordgren wrote: > In regards the the print statement, it was only moved down according > to the diff because I added more logic above. Basically there is 1) > the unrolling of the linked list to an array and 2) the printing > logic. I could move it and make the diff sm

Re: [PATCH] ls-remote: create option to sort by versions

2018-04-02 Thread Harald Nordgren
Thanks for your comment Ævar! In regards the the print statement, it was only moved down according to the diff because I added more logic above. Basically there is 1) the unrolling of the linked list to an array and 2) the printing logic. I could move it and make the diff smaller, but that probabl

Re: [PATCH] ls-remote: create option to sort by versions

2018-04-01 Thread Ævar Arnfjörð Bjarmason
On Mon, Apr 02 2018, Harald Nordgren wrote: > Create the options '-V ' and '--version-sort' to sort > 'git ls-remote' output by version semantics. This is useful e.g. for > the Go repository after the release of version 1.10, where otherwise > v1.10 is sorted before v1.2. See: > > $ git ls-

[PATCH] ls-remote: create option to sort by versions

2018-04-01 Thread Harald Nordgren
Create the options '-V ' and '--version-sort' to sort 'git ls-remote' output by version semantics. This is useful e.g. for the Go repository after the release of version 1.10, where otherwise v1.10 is sorted before v1.2. See: $ git ls-remote -t https://go.googlesource.com/go ...