Re: [RFC/PATCH 07/11] branch: move 'current' check down to the presentation layer

2015-07-29 Thread Karthik Nayak
On Wed, Jul 29, 2015 at 6:16 AM, Jacob Keller wrote: > On Tue, Jul 28, 2015 at 1:12 PM, Karthik Nayak wrote: >> On Tue, Jul 28, 2015 at 6:39 PM, Matthieu Moy >> wrote: >>> Karthik Nayak writes: >>> >>>> We check if given ref is the current branch

Re: [RFC/PATCH 06/11] branch: roll show_detached HEAD into regular ref_list

2015-07-29 Thread Karthik Nayak
On Wed, Jul 29, 2015 at 3:26 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Tue, Jul 28, 2015 at 6:31 PM, Matthieu Moy >> wrote: >>> >>>> -static void show_detached(struct ref_list *ref_list, int maxwidth) >&g

Re: [RFC/PATCH 04/11] ref-filter: add 'ifexists' atom

2015-07-29 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 11:27 PM, Junio C Hamano wrote: > Karthik Nayak writes: > >> The 'ifexists' atom allows us to print a required format if the >> preceeding atom has a value. If the preceeding atom has no value then >> the format given is not printed. e.

Re: [PATCH v5 07/11] ref-filter: add option to match literal pattern

2015-07-29 Thread Karthik Nayak
On Wed, Jul 29, 2015 at 3:19 AM, Eric Sunshine wrote: > On Mon, Jul 27, 2015 at 3:27 AM, Karthik Nayak wrote: >> From: Karthik Nayak >> >> Since 'ref-filter' only has an option to match path names add an >> option for plain fnmatch pattern-matching. >>

Re: [PATCH v5 03/11] ref-filter: add option to pad atoms to the right

2015-07-29 Thread Karthik Nayak
On Wed, Jul 29, 2015 at 3:11 AM, Eric Sunshine wrote: > On Mon, Jul 27, 2015 at 3:27 AM, Karthik Nayak wrote: >> Add a new atom "padright" and support %(padright:X) where X is a >> number. This will align the succeeding atom value to the left >> followed by

Re: [PATCH] ref-filter: fix indentation

2015-07-29 Thread Karthik Nayak
tch_name_as_path(filter->name_patterns, refname)) > -- > 2.5.0.rc0.7.ge1edd74.dirty > > -- > To unsubscribe from this list: send the line "unsubscribe git" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majo

Re: [PATCH v6 01/10] ref-filter: introduce 'ref_formatting_state'

2015-07-29 Thread Karthik Nayak
On Wed, Jul 29, 2015 at 9:34 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> Ah, I hate making grammatical errors, Even though I check it always gets >> away. >> Anyways waiting for Junio and others to reply on this version. Could do a >> resend >> f

Re: [RFC/PATCH 01/11] ref-filter: add "%(objectname:size=X)" option

2015-07-29 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 9:49 PM, Junio C Hamano wrote: > Karthik Nayak writes: > >> From: Karthik Nayak >> >> Add support for %(objectname:size=X) where X is a number. >> This will print the first X characters of an objectname. >> The minimum value for X is

Re: [PATCH v6 01/10] ref-filter: introduce 'ref_formatting_state'

2015-07-29 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 12:56 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> -static void print_value(struct atom_value *v, int quote_style) >> +static void apply_formatting_state(struct ref_formatting_state *state, >> +struct atom

Re: [RFC/PATCH] Port branch.c to use ref-filter APIs

2015-07-29 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 11:23 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Tue, Jul 28, 2015 at 7:05 PM, Matthieu Moy >> wrote: >> >>> Ideally, you could also have a modifier atom %(alignleft) [...] >> >> This could work for refname, as

Re: [RFC/PATCH 11/11] branch: add '--points-at' option

2015-07-29 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 1:16 PM, Jacob Keller wrote: > On Tue, Jul 28, 2015 at 12:11 AM, Karthik Nayak wrote: >> Add the '--points-at' option provided by 'ref-filter'. The option lets >> the user to list only branches which points at the given object. >&g

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

2015-07-29 Thread Karthik Nayak
t > (any plan on how to fix it?). > On the other hand I wonder if the test is even needed as, we don't really need it Cause we remove that ability of branch.c by using filter_refs(). -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line "unsub

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, >>

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 &g

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

Re: [RFC/PATCH 09/11] branch.c: use 'ref-filter' data structures

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 7:18 PM, Matthieu Moy wrote: > Christian Couder writes: > >> On Tue, Jul 28, 2015 at 8:56 AM, Karthik Nayak wrote: >> >>> +static void ref_array_append(struct ref_array *array, const char *refname) >>> +{ >>> + siz

Re: [RFC/PATCH 09/11] branch.c: use 'ref-filter' data structures

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 1:47 PM, Christian Couder wrote: > On Tue, Jul 28, 2015 at 8:56 AM, Karthik Nayak wrote: > >> +static void ref_array_append(struct ref_array *array, const char *refname) >> +{ >> + size_t len = strlen(refname); >> + struct r

Re: [RFC/PATCH 09/11] branch.c: use 'ref-filter' data structures

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 1:52 PM, Christian Couder wrote: > On Tue, Jul 28, 2015 at 8:56 AM, Karthik Nayak wrote: >> diff --git a/ref-filter.h b/ref-filter.h >> index 7d1871d..3458595 100644 >> --- a/ref-filter.h >> +++ b/ref-filter.h >> @@ -5,6 +5,7 @@ &

Re: [RFC/PATCH 07/11] branch: move 'current' check down to the presentation layer

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 6:39 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> We check if given ref is the current branch in print_ref_list(). Move >> this check to print_ref_item() where it is checked right before >> printing. > > This means that the '*

Re: [RFC/PATCH 06/11] branch: roll show_detached HEAD into regular ref_list

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 6:31 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> Remove show_detached() and make detached HEAD to be rolled into >> regular ref_list by adding REF_DETACHED_HEAD as a kind of branch and >> supporting the same in append_ref(). > &

Re: [RFC/PATCH 05/11] branch: fix width computation

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 3:17 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> From: Karthik Nayak > > Why did send-email add this From: header? Strange, it has the same > content as your actual From: field. > Not sure why, everything else came out fine. Idk what h

Re: [RFC/PATCH 04/11] ref-filter: add 'ifexists' atom

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 2:20 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> --- a/t/t6302-for-each-ref-filter.sh >> +++ b/t/t6302-for-each-ref-filter.sh >> @@ -149,4 +149,25 @@ test_expect_success 'check `colornext` format option'

Re: [RFC/PATCH 04/11] ref-filter: add 'ifexists' atom

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 1:24 PM, Jacob Keller wrote: > On Mon, Jul 27, 2015 at 11:56 PM, Karthik Nayak wrote: >> The 'ifexists' atom allows us to print a required format if the >> preceeding atom has a value. If the preceeding atom has no value then > > Don&#

Re: [RFC/PATCH 03/11] ref-filter: add option to filter only branches

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 7:08 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> +static int filter_branch_kind(struct ref_filter *filter, const char >> *refname) >> +{ >> + int kind, i; >> + >> + static struct { >> +

Re: [RFC/PATCH 02/11] ref-filter: add 'colornext' atom

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 2:43 PM, Christian Couder wrote: > On Tue, Jul 28, 2015 at 8:56 AM, Karthik Nayak wrote: >> @@ -712,6 +713,15 @@ static void populate_value(struct ref_array_item *ref) >> v->modifier_atom = 1; >>

Re: [RFC/PATCH 02/11] ref-filter: add 'colornext' atom

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 2:15 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> --- a/t/t6302-for-each-ref-filter.sh >> +++ b/t/t6302-for-each-ref-filter.sh >> @@ -133,4 +133,20 @@ test_expect_success 'reverse version sort' ' >>

Re: [RFC/PATCH 01/11] ref-filter: add "%(objectname:size=X)" option

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 9:13 PM, Junio C Hamano wrote: > Karthik Nayak writes: > >> From: Karthik Nayak >> >> Add support for %(objectname:size=X) where X is a number. >> This will print the first X characters of an objectname. >> The minimum value for X is

Re: [RFC/PATCH 01/11] ref-filter: add "%(objectname:size=X)" option

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 2:12 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> + if (skip_prefix(name, "objectname:size=", &p)) { >> + unsigned int size = atoi(p); > > You have the same problem as for tag.c: don't use atoi, and make

Re: [RFC/PATCH] Port branch.c to use ref-filter APIs

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 7:05 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> This version also doesn't use the printing options provided by >> branch.c. > > Do you mean "provided by ref-filter.{c,h}"? > Yes! my bad. >> I wanted to discuss h

[RFC/PATCH 11/11] branch: add '--points-at' option

2015-07-28 Thread Karthik Nayak
Add the '--points-at' option provided by 'ref-filter'. The option lets the user to list only branches which points at the given object. Add documentation and tests for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --

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

2015-07-28 Thread Karthik Nayak
#x27;ref-filter' to filter out tags based on the options set. We provide a sorting option provided for 'branch.c' by using the sorting options provided by 'ref-filter'. Modify documentation and add tests for the same. Mentored-by: Christian Couder Mentored-by: Matth

[RFC/PATCH 02/11] ref-filter: add 'colornext' atom

2015-07-27 Thread Karthik Nayak
Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 5 + ref-filter.c | 20 +++- ref-filter.h | 4 +++- t/t6302-for-each-ref-filter.sh | 16 4 fil

[RFC/PATCH 06/11] branch: roll show_detached HEAD into regular ref_list

2015-07-27 Thread Karthik Nayak
Signed-off-by: Karthik Nayak --- builtin/branch.c | 122 --- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index b058b74..f3d83d0 100644 --- a/builtin/branch.c +++ b/builtin/branch.c

[RFC/PATCH 09/11] branch.c: use 'ref-filter' data structures

2015-07-27 Thread Karthik Nayak
f-filter' completely. As this is a temporary step, most of the code introduced here will be removed when 'branch.c' is ported over to use 'ref-filter' APIs Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 289

[RFC/PATCH 05/11] branch: fix width computation

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Remove unnecessary variables from ref_list and ref_item which were used for width computation. Make other changes accordingly. This patch is a precursor for porting branch.c to use ref-filter APIs. Based-on-patch-by: Jeff King Mentored-by: Christian Couder Mentored-by

[RFC/PATCH 04/11] ref-filter: add 'ifexists' atom

2015-07-27 Thread Karthik Nayak
est for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 8 ref-filter.c | 37 ++--- ref-filter.h | 5 +++-- t/t6302-f

[RFC/PATCH 03/11] ref-filter: add option to filter only branches

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Add an option in 'filter_refs()' to use 'for_each_branch_ref()' and filter refs. This type checking is done by adding a 'FILTER_REFS_BRANCHES' in 'ref-filter.h'. Add an option in 'ref_filter_handler()' to filter differen

[RFC/PATCH 07/11] branch: move 'current' check down to the presentation layer

2015-07-27 Thread Karthik Nayak
We check if given ref is the current branch in print_ref_list(). Move this check to print_ref_item() where it is checked right before printing. Based-on-patch-by: Jeff King Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 29

[RFC/PATCH 08/11] branch: drop non-commit error reporting

2015-07-27 Thread Karthik Nayak
Based-on-patch-by: Jeff King Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index ba9cbad..8d0521e 100644

[RFC/PATCH 01/11] ref-filter: add "%(objectname:size=X)" option

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Add support for %(objectname:size=X) where X is a number. This will print the first X characters of an objectname. The minimum value for X is 5. Hence any value lesser than 5 will default to 5 characters. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off

[RFC/PATCH] Port branch.c to use ref-filter APIs

2015-07-27 Thread Karthik Nayak
g. Any tips or suggestions are welcome, thanks all :) -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH v6 03/10] ref-filter: add option to filter only tags

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Add a functions called 'for_each_tag_ref_fullpath()' to refs.{c,h} which iterates through each tag ref without trimming the path. Add an option in 'filter_refs()' to use 'for_each_tag_ref_fullpath()' and filter refs. This type checking is done

[PATCH v6 05/10] ref-filter: add support to sort by version

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Add support to sort by version using the "v:refname" and "version:refname" option. This is achieved by using the 'versioncmp()' function as the comparing function for qsort. This option is included to support sorting by versions in `git ta

[PATCH v6 10/10] tag.c: implement '--merged' and '--no-merged' options

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Using 'ref-filter' APIs implement the '--merged' and '--no-merged' options into 'tag.c'. The '--merged' option lets the user to only list tags merged into the named commit. The '--no-merged' option lets the user to o

[PATCH v6 02/10] ref-filter: add option to pad atoms to the right

2015-07-27 Thread Karthik Nayak
r the same. Helped-by: Duy Nguyen Helped-by: Junio C Hamano Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 6 ++ ref-filter.c | 27 +-- ref-filter.h

[PATCH v6 08/10] tag.c: use 'ref-filter' APIs

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Make 'tag.c' use 'ref-filter' APIs for iterating through refs sorting and printing of refs. This removes most of the code used in 'tag.c' replacing it with calls to the 'ref-filter' library. Make 'tag.c' use the 'filter_

[PATCH v6 04/10] ref-filter: support printing N lines from tag annotation

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak In 'tag.c' we can print N lines from the annotation of the tag using the '-n' option. Copy code from 'tag.c' to 'ref-filter' and modify 'ref-filter' to support printing of N lines from the annotation of tags. Mentored-by: C

[PATCH v6 07/10] tag.c: use 'ref-filter' data structures

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Make 'tag.c' use 'ref-filter' data structures and make changes to support the new data structures. This is a part of the process of porting 'tag.c' to use 'ref-filter' APIs. This is a temporary step before porting 'tag.c&

[PATCH v6 09/10] tag.c: implement '--format' option

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Implement the '--format' option provided by 'ref-filter'. This lets the user list tags as per desired format similar to the implementation in 'git for-each-ref'. Add tests and documentation for the same. Mentored-by: Christian Couder Mentore

[PATCH v6 06/10] ref-filter: add option to match literal pattern

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Since 'ref-filter' only has an option to match path names add an option for plain fnmatch pattern-matching. This is to support the pattern matching options which are used in `git tag -l` and `git branch -l` where we can match patterns like `git tag -l foo*` which w

[PATCH v6 01/10] ref-filter: introduce 'ref_formatting_state'

2015-07-27 Thread Karthik Nayak
: Matthieu Moy Signed-off-by: Karthik Nayak --- ref-filter.c | 71 +++- ref-filter.h | 5 + 2 files changed, 61 insertions(+), 15 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 7561727..a919a14 100644 --- a/ref-filter.c

[PATCH v6 0/10] port tag.c to use ref-filter APIs

2015-07-27 Thread Karthik Nayak
refs/tags/one|refs/tags/one|refs/tags/one| + refs/tags/signed-tag|refs/tags/signed-tag |refs/tags/signed-tag| +refs/tags/three|refs/tags/three |refs/tags/three| +refs/tags/two|refs/tags/two|refs/tags/two| EOF -git for-each-ref --format="%(padright:25)%(refname)|" >actual && +git for-each-ref --format="%(refname)%(padright:25)|%(refname)|%(refname)|" >actual && test_cmp expect actual ' -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v5 03/11] ref-filter: add option to pad atoms to the right

2015-07-27 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 12:17 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Mon, Jul 27, 2015 at 9:24 PM, Matthieu Moy >> wrote: >>> Yes, but on the other hand we already have: >>> >>> git log --format='%<|(50)A very long

Re: [PATCH v5 03/11] ref-filter: add option to pad atoms to the right

2015-07-27 Thread Karthik Nayak
On Mon, Jul 27, 2015 at 6:20 PM, Matthieu Moy wrote: > u > also need to check that it is taken into account for the right atom and > only this one. I'd suggest > > --format '%(refname)%(padright:25)|%(refname)|%(refname)|' I guess this is more accurate, Thanks. --

Re: [PATCH v5 03/11] ref-filter: add option to pad atoms to the right

2015-07-27 Thread Karthik Nayak
n is the right one. Sorry but I didn't understand what you're trying to say here, Matthieu. > >> My preference between the three is "%(padright:4)", etc. to apply to >> the "next span", but I can live with "it is an error to pad-right >> a far-a

Re: [PATCH v5 02/11] ref-filter: make `color` use `ref_formatting_state`

2015-07-27 Thread Karthik Nayak
On Mon, Jul 27, 2015 at 7:58 PM, Junio C Hamano wrote: > Matthieu Moy writes: > >> Karthik Nayak writes: >> >>> Make the `color` atom a pseudo atom and ensure that it uses >>> `ref_formatting_state`. >> >> Actually, I think this is an incorrect c

Re: [PATCH v5 02/11] ref-filter: make `color` use `ref_formatting_state`

2015-07-27 Thread Karthik Nayak
On Mon, Jul 27, 2015 at 6:36 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> --- a/ref-filter.c >> +++ b/ref-filter.c >> @@ -1195,6 +1197,11 @@ void ref_array_sort(struct ref_sorting *sorting, >> struct ref_array *array) >> static void ref_formattin

Re: [PATCH v4 05/10] ref-filter: add support to sort by version

2015-07-27 Thread Karthik Nayak
On Mon, Jul 27, 2015 at 8:54 PM, Junio C Hamano wrote: > Karthik Nayak writes: > >> On Sun, Jul 26, 2015 at 4:10 AM, Junio C Hamano wrote: >> >>> Without looking at the callers, s->version looks like a misdesign >>> that should be updated to use the same c

Re: [PATCH v5 07/11] ref-filter: add option to match literal pattern

2015-07-27 Thread Karthik Nayak
On Mon, Jul 27, 2015 at 9:36 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Mon, Jul 27, 2015 at 9:27 PM, Karthik Nayak wrote: >>> On Mon, Jul 27, 2015 at 6:24 PM, Matthieu Moy >>> wrote: >>>> Karthik Nayak writes: >>>

Re: [PATCH v5 02/11] ref-filter: make `color` use `ref_formatting_state`

2015-07-27 Thread Karthik Nayak
On Mon, Jul 27, 2015 at 6:17 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> Make the `color` atom a pseudo atom and ensure that it uses >> `ref_formatting_state`. > > Actually, I think this is an incorrect change. > > Previously, %(color:...) was taking effe

Re: [PATCH v5 07/11] ref-filter: add option to match literal pattern

2015-07-27 Thread Karthik Nayak
On Mon, Jul 27, 2015 at 9:27 PM, Karthik Nayak wrote: > On Mon, Jul 27, 2015 at 6:24 PM, Matthieu Moy > wrote: >> Karthik Nayak writes: >> >>> --- a/ref-filter.c >>> +++ b/ref-filter.c >>> @@ -946,6 +946,32 @@ static int commit_contains(struct r

Re: [PATCH v5 07/11] ref-filter: add option to match literal pattern

2015-07-27 Thread Karthik Nayak
On Mon, Jul 27, 2015 at 6:24 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> --- a/ref-filter.c >> +++ b/ref-filter.c >> @@ -946,6 +946,32 @@ static int commit_contains(struct ref_filter *filter, >> struct commit *commit) > >> +/* >> + * Return

Re: [PATCH v5 01/11] ref-filter: introduce 'ref_formatting_state'

2015-07-27 Thread Karthik Nayak
On Mon, Jul 27, 2015 at 6:12 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> +static void ref_formatting(struct ref_formatting_state *state, >> +struct atom_value *v, struct strbuf *value) >> { >> - struct strbuf sb = STRBUF_INIT

[PATCH v5 06/11] ref-filter: add support to sort by version

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Add support to sort by version using the "v:refname" and "version:refname" option. This is achieved by using the 'versioncmp()' function as the comparing function for qsort. This option is included to support sorting by versions in `git ta

[PATCH v5 10/11] tag.c: implement '--format' option

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Implement the '--format' option provided by 'ref-filter'. This lets the user list tags as per desired format similar to the implementation in 'git for-each-ref'. Add tests and documentation for the same. Mentored-by: Christian Couder Mentore

[PATCH v5 08/11] tag.c: use 'ref-filter' data structures

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Make 'tag.c' use 'ref-filter' data structures and make changes to support the new data structures. This is a part of the process of porting 'tag.c' to use 'ref-filter' APIs. This is a temporary step before porting 'tag.c&

[PATCH v5 11/11] tag.c: implement '--merged' and '--no-merged' options

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Using 'ref-filter' APIs implement the '--merged' and '--no-merged' options into 'tag.c'. The '--merged' option lets the user to only list tags merged into the named commit. The '--no-merged' option lets the user to o

[PATCH v5 02/11] ref-filter: make `color` use `ref_formatting_state`

2015-07-27 Thread Karthik Nayak
Make the `color` atom a pseudo atom and ensure that it uses `ref_formatting_state`. --- ref-filter.c | 19 ++- ref-filter.h | 4 +++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index a3625e8..cc25c85 100644 --- a/ref-filter.c +++ b/

[PATCH v5 04/11] ref-filter: add option to filter only tags

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Add a functions called 'for_each_tag_ref_fullpath()' to refs.{c,h} which iterates through each tag ref without trimming the path. Add an option in 'filter_refs()' to use 'for_each_tag_ref_fullpath()' and filter refs. This type checking is done

[PATCH v5 05/11] ref-filter: support printing N lines from tag annotation

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak In 'tag.c' we can print N lines from the annotation of the tag using the '-n' option. Copy code from 'tag.c' to 'ref-filter' and modify 'ref-filter' to support printing of N lines from the annotation of tags. Mentored-by: C

[PATCH v5 07/11] ref-filter: add option to match literal pattern

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Since 'ref-filter' only has an option to match path names add an option for plain fnmatch pattern-matching. This is to support the pattern matching options which are used in `git tag -l` and `git branch -l` where we can match patterns like `git tag -l foo*` which w

[PATCH v5 09/11] tag.c: use 'ref-filter' APIs

2015-07-27 Thread Karthik Nayak
From: Karthik Nayak Make 'tag.c' use 'ref-filter' APIs for iterating through refs sorting and printing of refs. This removes most of the code used in 'tag.c' replacing it with calls to the 'ref-filter' library. Make 'tag.c' use the 'filter_

[PATCH v5 03/11] ref-filter: add option to pad atoms to the right

2015-07-27 Thread Karthik Nayak
r the same. Helped-by: Duy Nguyen Helped-by: Junio C Hamano Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 6 ++ ref-filter.c | 24 ref-filter.h |

[PATCH v5 01/11] ref-filter: introduce 'ref_formatting_state'

2015-07-27 Thread Karthik Nayak
: Matthieu Moy Signed-off-by: Karthik Nayak --- ref-filter.c | 46 +++--- ref-filter.h | 5 + 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 7561727..a3625e8 100644 --- a/ref-filter.c +++ b/ref-filter.

[PATCH v5 00/11] port tag.c to use ref-filter APIs

2015-07-27 Thread Karthik Nayak
ag -l --sort=version:refname | grep "foo" >actual && +git for-each-ref --sort=version:refname --format="%(refname:short)" refs/tags/ | grep "foo" >actual && cat >expect <<-\EOF && foo1.3 foo1.6 @@ -98,7 +114,7 @

Re: [PATCH v4 06/10] ref-filter: add option to match literal pattern

2015-07-26 Thread Karthik Nayak
On Sun, Jul 26, 2015 at 10:45 AM, Eric Sunshine wrote: > On Fri, Jul 24, 2015 at 3:04 PM, Karthik Nayak wrote: >> Since 'ref-filter' only has an option to match path names add an >> option for plain fnmatch pattern-matching. >> >> This is to support the patte

Re: [PATCH v4 01/10] ref-filter: add option to align atoms to the left

2015-07-25 Thread Karthik Nayak
On Sun, Jul 26, 2015 at 11:28 AM, Eric Sunshine wrote: > On Sun, Jul 26, 2015 at 12:36 AM, Karthik Nayak wrote: >> On Sun, Jul 26, 2015 at 9:38 AM, Eric Sunshine >> wrote: >>> Also, it is helpful to reviewers if you include an interdiff at the >>> bottom

Re: [PATCH v4 02/10] ref-filter: make the 'color' use ref_formatting_state

2015-07-25 Thread Karthik Nayak
the end, you may find that patch 1 is so trivial that > it can be merged with patch 2 without making review more difficult, > however, keeping them distinct during development helps you avoid > conflating unrelated changes. > Yes! I'm doing that like Junio suggested. Thanks for bringing i

Re: [PATCH v4 04/10] ref-filter: support printing N lines from tag annotation

2015-07-25 Thread Karthik Nayak
On Sun, Jul 26, 2015 at 10:16 AM, Eric Sunshine wrote: > On Fri, Jul 24, 2015 at 3:04 PM, Karthik Nayak wrote: >> From: Karthik Nayak >> >> In 'tag.c' we can print N lines from the annotation of the tag using >> the '-n' option. Copy code from &#

Re: [PATCH v4 05/10] ref-filter: add support to sort by version

2015-07-25 Thread Karthik Nayak
On Sun, Jul 26, 2015 at 4:10 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> @@ -1180,19 +1181,17 @@ static int cmp_ref_sorting(struct ref_sorting *s, >> struct ref_array_item *a, stru >> >> get_ref_atom_value(&state, a, s->atom, &va); >&

Re: [PATCH v4 01/10] ref-filter: add option to align atoms to the left

2015-07-25 Thread Karthik Nayak
On Sun, Jul 26, 2015 at 9:38 AM, Eric Sunshine wrote: > On Fri, Jul 24, 2015 at 3:04 PM, Karthik Nayak wrote: >> Add a new atom "align" and support %(align:X) where X is a number. >> This will align the preceeding atom value to the left followed by > > Do you mean

Re: [PATCH v4 02/10] ref-filter: make the 'color' use ref_formatting_state

2015-07-24 Thread Karthik Nayak
On Sat, Jul 25, 2015 at 3:16 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> Make color which was considered as an atom, to use >> ref_formatting_state and act as a pseudo atom. This allows >> interchangeability between 'align' and 'color'. >

Re: [PATCH v4 01/10] ref-filter: add option to align atoms to the left

2015-07-24 Thread Karthik Nayak
On Sat, Jul 25, 2015 at 4:30 AM, Junio C Hamano wrote: > Junio C Hamano writes: > >> Karthik Nayak writes: >> >>> -if (!ref->value) { >>> -populate_value(ref); >>> +/* >>> + * If the atom is a pseud

[PATCH v4 10/10] tag.c: implement '--merged' and '--no-merged' options

2015-07-24 Thread Karthik Nayak
From: Karthik Nayak Using 'ref-filter' APIs implement the '--merged' and '--no-merged' options into 'tag.c'. The '--merged' option lets the user to only list tags merged into the named commit. The '--no-merged' option lets the user to o

[PATCH v4 09/10] tag.c: implement '--format' option

2015-07-24 Thread Karthik Nayak
From: Karthik Nayak Implement the '--format' option provided by 'ref-filter'. This lets the user list tags as per desired format similar to the implementation in 'git for-each-ref'. Add tests and documentation for the same. Mentored-by: Christian Couder Mentore

[PATCH v4 08/10] tag.c: use 'ref-filter' APIs

2015-07-24 Thread Karthik Nayak
From: Karthik Nayak Make 'tag.c' use 'ref-filter' APIs for iterating through refs sorting and printing of refs. This removes most of the code used in 'tag.c' replacing it with calls to the 'ref-filter' library. Make 'tag.c' use the 'filter_

[PATCH v4 06/10] ref-filter: add option to match literal pattern

2015-07-24 Thread Karthik Nayak
From: Karthik Nayak Since 'ref-filter' only has an option to match path names add an option for plain fnmatch pattern-matching. This is to support the pattern matching options which are used in `git tag -l` and `git branch -l` where we can match patterns like `git tag -l foo*` which w

[PATCH v4 01/10] ref-filter: add option to align atoms to the left

2015-07-24 Thread Karthik Nayak
From: Karthik Nayak Add a new atom "align" and support %(align:X) where X is a number. This will align the preceeding atom value to the left followed by spaces for a total length of X characters. If X is less than the item size, the entire atom value is printed. Helped-by: Duy Nguyen

[PATCH v4 04/10] ref-filter: support printing N lines from tag annotation

2015-07-24 Thread Karthik Nayak
From: Karthik Nayak In 'tag.c' we can print N lines from the annotation of the tag using the '-n' option. Copy code from 'tag.c' to 'ref-filter' and modify 'ref-filter' to support printing of N lines from the annotation of tags. Mentored-by: C

[PATCH v4 03/10] ref-filter: add option to filter only tags

2015-07-24 Thread Karthik Nayak
From: Karthik Nayak Add a functions called 'for_each_tag_ref_fullpath()' to refs.{c,h} which iterates through each tag ref without trimming the path. Add an option in 'filter_refs()' to use 'for_each_tag_ref_fullpath()' and filter refs. This type checking is done

[PATCH v4 05/10] ref-filter: add support to sort by version

2015-07-24 Thread Karthik Nayak
From: Karthik Nayak Add support to sort by version using the "v:refname" and "version:refname" option. This is achieved by using the 'versioncmp()' function as the comparing function for qsort. This option is included to support sorting by versions in `git ta

[PATCH v4 02/10] ref-filter: make the 'color' use ref_formatting_state

2015-07-24 Thread Karthik Nayak
Make color which was considered as an atom, to use ref_formatting_state and act as a pseudo atom. This allows interchangeability between 'align' and 'color'. Helped-by: Junio C Hamano Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --

[PATCH v4 07/10] tag.c: use 'ref-filter' data structures

2015-07-24 Thread Karthik Nayak
From: Karthik Nayak Make 'tag.c' use 'ref-filter' data structures and make changes to support the new data structures. This is a part of the process of porting 'tag.c' to use 'ref-filter' APIs. This is a temporary step before porting 'tag.c&

[PATCH v4 0/10] port tag.c to use ref-filter APIs

2015-07-24 Thread Karthik Nayak
This is part of my GSoC project to unify git tag -l, git branch -l, git for-each-ref. This patch series is continued from: Git (next) https://github.com/git/git/commit/bf5418f49ff0cebc6e5ce04ad1417e1a47c81b61 Version 3 can be found here http://thread.gmane.org/gmane.comp.version-control.git/27416

Re: [PATCH v3 9/9] tag.c: implement '--merged' and '--no-merged' options

2015-07-23 Thread Karthik Nayak
On Thu, Jul 23, 2015 at 1:10 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> +--merged []:: >> + Only list tags whose tips are reachable from the >> + specified commit (HEAD if not specified). >> + >> +--no-merged []:: >> + Only list

Re: [PATCH v3 1/9] ref-filter: add option to align atoms to the left

2015-07-23 Thread Karthik Nayak
On Thu, Jul 23, 2015 at 12:14 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> + strtoul_ui(valp, 10, &ref->align_value); >> + if (ref->align_value < 1) >> + die(_("Value shou

Re: [PATCH v3 9/9] tag.c: implement '--merged' and '--no-merged' options

2015-07-21 Thread Karthik Nayak
On Mon, Jul 20, 2015 at 12:50 AM, Christian Couder wrote: > On Sun, Jul 19, 2015 at 12:00 AM, Karthik Nayak wrote: >> From: Karthik Nayak >> >> Using 'ref-filter' APIs implement the '--merged' and '--no-merged' >> options into 'ta

Re: [PATCH v3 5/9] ref-filter: add option to match literal pattern

2015-07-21 Thread Karthik Nayak
On Mon, Jul 20, 2015 at 11:42 PM, Eric Sunshine wrote: > On Mon, Jul 20, 2015 at 4:01 AM, Christian Couder > wrote: >> On Mon, Jul 20, 2015 at 8:24 AM, Eric Sunshine >> wrote: >>> On Sat, Jul 18, 2015 at 3:12 PM, Karthik Nayak >>> wrote: >>

Re: [PATCH v3 1/9] ref-filter: add option to align atoms to the left

2015-07-21 Thread Karthik Nayak
ngs like that > if desired. This implementation looks good. Will include this, thanks a bunch. > > We may want to further clean up to update %(color) thing to clarify > that it is a pseudo atom. I suspect %(align:20)%(color:blue) would > do a wrong thing with the current code, and it would be a reasonable > thing to allow both of these interchangeably: > > %(align:20)%(color:blue)%(refname:short)%(color:reset) > %(color:blue)%(align:20)%(refname:short)%(color:reset) > > and implementation of that would become more obvious once you have a > more explicit "formatting state" that is known to and shared among > get_value(), the for() loop that walks the format string, and > print_value(). Yup! ill put in a fix for %(color:) with this patch. Thanks a lot. -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v3 1/9] ref-filter: add option to align atoms to the left

2015-07-20 Thread Karthik Nayak
On Mon, Jul 20, 2015 at 11:31 PM, Eric Sunshine wrote: > On Mon, Jul 20, 2015 at 1:22 PM, Karthik Nayak wrote: >> Add a new atom "align" and support %(align:X) where X is a number. >> This will align the preceeding atom value to the left followed by >> spaces for

<    5   6   7   8   9   10   11   12   13   14   >