Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-08-19 Thread Karthik Nayak
On Wed, Aug 19, 2015 at 9:19 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Thu, Jul 30, 2015 at 12:59 PM, Matthieu Moy >> wrote: >> >>> IIRC, historicaly Git allowed some weirdly named refs which made some >>> commands ambiguous (e.g. a branch named after an option like '-d'). >>> We'r

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-08-19 Thread Matthieu Moy
Karthik Nayak writes: > On Thu, Jul 30, 2015 at 12:59 PM, Matthieu Moy > wrote: > >> IIRC, historicaly Git allowed some weirdly named refs which made some >> commands ambiguous (e.g. a branch named after an option like '-d'). >> We're forbidding their creation so people shouldn't have any, but w

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-08-03 Thread Karthik Nayak
On Thu, Jul 30, 2015 at 12:59 PM, Matthieu Moy wrote: > Karthik Nayak writes: > > Solving this doesn't seem much harder than > > diff --git a/ref-filter.c b/ref-filter.c > index 6c0189f..a4df287 100644 > --- a/ref-filter.c > +++ b/ref-filter.c > @@ -1117,7 +1117,7 @@ static int ref_filter_handler

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-30 Thread Matthieu Moy
Karthik Nayak writes: > On Wed, Jul 29, 2015 at 9:26 PM, Matthieu Moy > wrote: >> Karthik Nayak writes: >> >>> On Tue, Jul 28, 2015 at 7:47 PM, Matthieu Moy >>> wrote: I'm not sure what's the convention, but I think the test description should give the expected behavior even wit

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-29 Thread Karthik Nayak
On Wed, Jul 29, 2015 at 9:26 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Tue, Jul 28, 2015 at 7:47 PM, Matthieu Moy >> wrote: >>> >>> I'm not sure what's the convention, but I think the test description >>> should give the expected behavior even with test_expect_failure. >>> >>> And

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-29 Thread Matthieu Moy
Karthik Nayak writes: > On Tue, Jul 28, 2015 at 7:47 PM, Matthieu Moy > wrote: >> >> I'm not sure what's the convention, but I think the test description >> should give the expected behavior even with test_expect_failure. >> >> And please help the reviewers by saying what's the status wrt this t

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-29 Thread Matthieu Moy
Karthik Nayak writes: > On Tue, Jul 28, 2015 at 7:47 PM, Matthieu Moy > wrote: > >>> - qsort(array.items, index, sizeof(struct ref_array_item *), ref_cmp); >>> + if (!sorting) { >>> + def_sorting.next = NULL; >>> + def_sorting.atom = parse_ref_filter_atom(sort_typ

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-29 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 7:47 PM, Matthieu Moy wrote: > > I'm not sure what's the convention, but I think the test description > should give the expected behavior even with test_expect_failure. > > And please help the reviewers by saying what's the status wrt this test > (any plan on how to fix it?

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-29 Thread Karthik Nayak
Re-sending this as it wasn't sent as plain text and failed. On Tue, Jul 28, 2015 at 7:47 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> @@ -458,7 +345,7 @@ static void add_verbose_info(struct strbuf *out, struct >> ref_array_item *item, >> } >> >> if (item->kind == REF_LOCAL_B

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 1:39 PM, Christian Couder wrote: > On Tue, Jul 28, 2015 at 9:11 AM, Karthik Nayak wrote: > >> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt >> index a67138a..897cd81 100644 >> --- a/Documentation/git-branch.txt >> +++ b/Documentation/git-branch.t

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 1:27 PM, Jacob Keller wrote: > On Tue, Jul 28, 2015 at 12:11 AM, Karthik Nayak wrote: >> Make 'branch.c' use 'ref-filter' APIs for iterating through refs >> sorting. This removes most of the code used in 'branch.c' replacing it >> with calls to the 'ref-filter' library. >>

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Matthieu Moy
Karthik Nayak writes: > @@ -458,7 +345,7 @@ static void add_verbose_info(struct strbuf *out, struct > ref_array_item *item, > } > > if (item->kind == REF_LOCAL_BRANCH) > - fill_tracking_info(&stat, item->refname, filter->verbose > 1); > + fill_tracking_info(

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Christian Couder
On Tue, Jul 28, 2015 at 9:11 AM, Karthik Nayak wrote: > diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt > index a67138a..897cd81 100644 > --- a/Documentation/git-branch.txt > +++ b/Documentation/git-branch.txt > @@ -11,7 +11,7 @@ SYNOPSIS > 'git branch' [--color[=] | --n

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Jacob Keller
On Tue, Jul 28, 2015 at 12:11 AM, Karthik Nayak wrote: > Make 'branch.c' use 'ref-filter' APIs for iterating through refs > sorting. This removes most of the code used in 'branch.c' replacing it > with calls to the 'ref-filter' library. > > Make 'tag.c' use the 'filter_refs()' function provided by

[RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Karthik Nayak
Make 'branch.c' use 'ref-filter' APIs for iterating through refs sorting. This removes most of the code used in 'branch.c' replacing it with calls to the 'ref-filter' library. Make 'tag.c' use the 'filter_refs()' function provided by 'ref-filter' to filter out tags based on the options set. We pr