Re: [PATCH v7] ls-remote: create '--sort' option

2018-04-04 Thread Jeff King
On Wed, Apr 04, 2018 at 07:18:42PM +0200, Harald Nordgren wrote: > Jeff, you are right that 'git ls-remote --sort=committerdate' will not > work. Do you think we need to do something about this, or it's fine > that it fails the way you showed? It's a reasonable-sized footgun, but one that I

Re: [PATCH v7] ls-remote: create '--sort' option

2018-04-04 Thread Jeff King
On Wed, Apr 04, 2018 at 07:11:53PM +0200, Harald Nordgren wrote: > @@ -60,6 +60,16 @@ OPTIONS > upload-pack only shows the symref HEAD, so it will be the only > one shown by ls-remote. > > +--sort=:: > + Sort based on the key given. Prefix `-` to sort in > + descending

Re: [PATCH v7] ls-remote: create '--sort' option

2018-04-04 Thread Harald Nordgren
Links to previous revisions: [1] https://public-inbox.org/git/20180402174614.ga28...@sigill.intra.peff.net/T/#m108fe8c83f3558afaea8e317e680f7eaa136e9a9 [2] https://public-inbox.org/git/20180402211920.ga32...@sigill.intra.peff.net/T/#ma9ec4e0ce664160086e535c012e20d76822c60e5 ... [4]

Re: [PATCH v7] ls-remote: create '--sort' option

2018-04-04 Thread Harald Nordgren
I updated the code to use 'ALLOC_GROW'. I makes sense, I now I realize why array.alloc is there ;) Jeff, you are right that 'git ls-remote --sort=committerdate' will not work. Do you think we need to do something about this, or it's fine that it fails the way you showed? On Wed, Apr 4, 2018 at

[PATCH v7] ls-remote: create '--sort' option

2018-04-04 Thread Harald Nordgren
Create a '--sort' option for ls-remote, based on the one from for-each-ref. This e.g. allows ref names to be sorted by version semantics, so that v1.2 is sorted before v1.10. Signed-off-by: Harald Nordgren --- Notes: Started using 'ALLOC_GROW'