Re: [PATCH v2 04/10] ref-filter: add support to sort by version
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jul 11, 2015, 05:54 UTC
- Message-ID
- <CAOLa=ZSuftULFSCKK=PoaPejA_FXGkmVrOybk1G6OEjDchfSEg@mail.gmail.com>
- In-Reply-To
- <vpqd2005hq4.fsf@anie.imag.fr>
On Fri, Jul 10, 2015 at 5:48 PM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 30 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes: > >> On Fri, Jul 10, 2015 at 4:22 PM, Karthik Nayak <karthik.188@gmail.com> wrote: >>> On Thu, Jul 9, 2015 at 6:59 PM, Matthieu Moy >>> <Matthieu.Moy@grenoble-inp.fr> wrote: >>>> Karthik Nayak <karthik.188@gmail.com> writes: >>>> >>>>> Add support to sort by version using the "v:refname" and >>>>> "version:refname" option. This is achieved by using the >>>>> 'version_cmp()' function as the comparing function for qsort. >>>> >>>> You should elaborate on why you need this. Given the context, I can >>>> guess that you will need this to implement tag, but for example I first >>>> wondered why you needed both version: and v:, but I guess it comes from >>>> the fact that 'git tag --sort' can take version:refname or v:refname. >>>> >>>> I think this deserves a test and documentation in for-each-ref.txt. >>> >>> I'll add it to "for-each-ref.txt" documentation. >>> About the tests, there are already tests for the same in git-tag.txt and >>> that's the only reason I did not repeat the tests in for-each-ref. >>> >> >> But since the porting is in a later commit, will add tests to for-each-ref. > > Yes: to me "it's tested through 'git tag'" is a good argument to do only > a superficial test, check that 'for-each-ref --sort v:refname' activate > the sorting, but no detailed corner-case testing. But not a good > argument to have no test at all on for-each-ref. >
Agreed, I've written tests for the same.
-- Regards, Karthik Nayak