[PATCH v15 11/13] tag.c: use 'ref-filter' APIs

2015-09-01 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> 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_refs()' function pr

[PATCH v15 08/13] ref-filter: add support to sort by version

2015-09-01 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> 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 vers

[PATCH v15 12/13] tag.c: implement '--format' option

2015-09-01 Thread Karthik Nayak
eu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-tag.txt | 8 +++- builtin/tag.c | 22 +- t/t7004-tag.sh| 12 3 files changed, 32 insertions(+), 10 deleti

Re: [PATCH v14 00/13] Port tag.c to use ref-filter.c

2015-09-01 Thread Karthik Nayak
On Mon, Aug 31, 2015 at 5:06 PM, Karthik Nayak <karthik@gmail.com> wrote: > On Mon, Aug 31, 2015 at 1:01 PM, Matthieu Moy > <matthieu@grenoble-inp.fr> wrote: >> Karthik Nayak <karthik@gmail.com> writes: >> >>> * We perform quoting

Re: GSoC 2015 is over

2015-09-01 Thread Karthik Nayak
ugh the project and sparing time for reviews and suggestions, also thanks to everyone else for their suggestions over the course of the project, especially Junio and Eric :) Theres still a lot to do with respect to the project, and I dedicate myself to finishing it completely. And even continue contributi

[PATCH v15 00/13] port builtin/tag.c to use ref-filter APIs.

2015-09-01 Thread Karthik Nayak
and rely on the quoting performed by element two. Karthik Nayak (13): ref-filter: move `struct atom_value` to ref-filter.c ref-filter: introduce ref_formatting_state and ref_formatting_stack utf8: add function to align a string into given strbuf ref-filter: introduce handler function for each

[PATCH v15 02/13] ref-filter: introduce ref_formatting_state and ref_formatting_stack

2015-09-01 Thread Karthik Nayak
() -> append_atom() emit()-> append_literal() Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- ref-filter.c | 78 +++

[PATCH v15 03/13] utf8: add function to align a string into given strbuf

2015-09-01 Thread Karthik Nayak
gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- utf8.c | 21 + utf8.h | 15 +++ 2 files changed, 36 insertions(+) diff --git a/utf8.c b/utf8.c index 28e6d76..00e10c8 100644 -

[PATCH v15 05/13] ref-filter: implement an `align` atom

2015-09-01 Thread Karthik Nayak
-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 9 ref-filter.c | 102 - t/t6302-for-each-ref-filter.sh | 85 +++ 3 files changed, 1

[PATCH v15 04/13] ref-filter: introduce handler function for each atom

2015-09-01 Thread Karthik Nayak
<christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- ref-filter.c | 54 ++ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/ref-filte

[PATCH v15 01/13] ref-filter: move `struct atom_value` to ref-filter.c

2015-09-01 Thread Karthik Nayak
.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- ref-filter.c | 5 + ref-filter.h | 5 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 46963a5..e53c77e 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -55,6 +55,11 @@ static s

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

2015-09-01 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> 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' to use 'ref-filter' comp

[PATCH v15 06/13] ref-filter: add option to filter out tags, branches and remotes

2015-09-01 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Add a function called 'for_each_fullref_in()' to refs.{c,h} which iterates through each ref for the given path without trimming the path and also accounting for broken refs, if mentioned. Add 'filter_ref_kind()' in ref-filter.c to check the kind

[PATCH v15 09/13] ref-filter: add option to match literal pattern

2015-09-01 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> 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

[PATCH v15 07/13] ref-filter: add support for %(contents:lines=X)

2015-09-01 Thread Karthik Nayak
. Add documentation and test for the same. Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 3

[PATCH v15 13/13] tag.c: implement '--merged' and '--no-merged' options

2015-09-01 Thread Karthik Nayak
it assumes HEAD as the object. Add documentation and tests for the same. Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-tag.txt | 7

Re: [PATCH v15 06/13] ref-filter: add option to filter out tags, branches and remotes

2015-09-01 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 3:00 AM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> + if (!filter->kind) >> die("filter_refs: invalid type"); >> + else { >>

Re: [PATCH v14 04/13] ref-filter: implement an `align` atom

2015-09-01 Thread Karthik Nayak
On Tue, Sep 1, 2015 at 6:41 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> Like this: >> >> else if (skip_prefix(name, "align", )) { >> struct align

Re: [PATCH v14 04/13] ref-filter: implement an `align` atom

2015-09-01 Thread Karthik Nayak
fix(name, "align", )) { struct align *align = >u.align; struct strbuf **s; if (valp[0] != ':') die(_("format: usage %%(align:,)")); else valp++; .. } -- 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 v14 00/13] Port tag.c to use ref-filter.c

2015-08-31 Thread Karthik Nayak
On Mon, Aug 31, 2015 at 1:01 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> * We perform quoting on each layer of nested alignment. > > I do not understand why. > > For example, using the

Re: [PATCH v14 04/13] ref-filter: implement an `align` atom

2015-08-31 Thread Karthik Nayak
On Mon, Aug 31, 2015 at 3:44 PM, Karthik Nayak <karthik@gmail.com> wrote: > On Mon, Aug 31, 2015 at 4:26 AM, Eric Sunshine <sunsh...@sunshineco.com> > wrote: >> On Sun, Aug 30, 2015 at 1:27 PM, Junio C Hamano <gits...@pobox.com> wrote: >>> Eric Su

Re: [PATCH v14 04/13] ref-filter: implement an `align` atom

2015-08-31 Thread Karthik Nayak
reset(>output); > strbuf_addbuf(>output, ); > } > > Aren't both the comment and the condition backward? Shouldn't quoting > be done only for the top-most state on the stack rather than every > state other than the top-most? That is, shouldn't the condition be > `!state->stack-&

Re: [PATCH v14 00/13] Port tag.c to use ref-filter.c

2015-08-31 Thread Karthik Nayak
On Mon, Aug 31, 2015 at 12:20 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> diff --git a/Documentation/git-for-each-ref.txt >> b/Documentation/git-for-each-ref.txt >> index 06d468e..1b48b95 100644

Re: [PATCH v14 04/13] ref-filter: implement an `align` atom

2015-08-31 Thread Karthik Nayak
On Sun, Aug 30, 2015 at 3:10 PM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Sun, Aug 30, 2015 at 9:38 AM, Karthik Nayak <karthik@gmail.com> wrote: >> On Sun, Aug 30, 2015 at 8:57 AM, Eric Sunshine <sunsh...@sunshineco.com> >> wrote: >>> On Sa

Re: [PATCH v14 04/13] ref-filter: implement an `align` atom

2015-08-31 Thread Karthik Nayak
On Mon, Aug 31, 2015 at 3:29 AM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Sun, Aug 30, 2015 at 10:57 AM, Karthik Nayak <karthik@gmail.com> wrote: >> On Sun, Aug 30, 2015 at 8:57 AM, Eric Sunshine <sunsh...@sunshineco.com> >> wrote: >>>

Re: [PATCH v14 04/13] ref-filter: implement an `align` atom

2015-08-31 Thread Karthik Nayak
estion. So I'll push that soon, and more changes can be then added to the top of the series. Thanks for the suggestion. -- 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 v14 05/13] ref-filter: add option to filter out tags, branches and remotes

2015-08-30 Thread Karthik Nayak
On Sun, Aug 30, 2015 at 9:00 AM, Eric Sunshine sunsh...@sunshineco.com wrote: On Sat, Aug 29, 2015 at 10:12 AM, Karthik Nayak karthik@gmail.com wrote: Add a function called 'for_each_fullref_in()' to refs.{c,h} which iterates through each ref for the given path without trimming the path

Re: [PATCH v14 06/13] ref-filter: introduce format_ref_array_item()

2015-08-30 Thread Karthik Nayak
On Sun, Aug 30, 2015 at 9:12 AM, Eric Sunshine sunsh...@sunshineco.com wrote: On Sat, Aug 29, 2015 at 10:12 AM, Karthik Nayak karthik@gmail.com wrote: Create format_ref_array_item() out of show_ref_array_item(). This will store the output format for the given ref_array_item

Re: [PATCH v14 06/13] ref-filter: introduce format_ref_array_item()

2015-08-30 Thread Karthik Nayak
On Sun, Aug 30, 2015 at 9:12 AM, Eric Sunshine sunsh...@sunshineco.com wrote: On Sat, Aug 29, 2015 at 10:12 AM, Karthik Nayak karthik@gmail.com wrote: Create format_ref_array_item() out of show_ref_array_item(). This will store the output format for the given ref_array_item

Re: [PATCH v14 07/13] ref-filter: add support for %(contents:lines=X)

2015-08-30 Thread Karthik Nayak
, we're on the same page :) -- 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 v14 04/13] ref-filter: implement an `align` atom

2015-08-30 Thread Karthik Nayak
On Sun, Aug 30, 2015 at 8:57 AM, Eric Sunshine sunsh...@sunshineco.com wrote: Add documentation and tests for the same. Signed-off-by: Karthik Nayak karthik@gmail.com --- diff --git a/ref-filter.c b/ref-filter.c index 432cea0..21c8b5f 100644 --- a/ref-filter.c +++ b/ref-filter.c

Re: [PATCH v14 07/13] ref-filter: add support for %(contents:lines=X)

2015-08-30 Thread Karthik Nayak
On Sun, Aug 30, 2015 at 1:23 PM, Eric Sunshine sunsh...@sunshineco.com wrote: On Sat, Aug 29, 2015 at 10:12 AM, Karthik Nayak karthik@gmail.com wrote: In 'tag.c' we can print N lines from the annotation of the tag using the '-nnum' option. Copy code from 'tag.c' to 'ref-filter' and modify

Re: [PATCH v14 07/13] ref-filter: add support for %(contents:lines=X)

2015-08-30 Thread Karthik Nayak
On Sun, Aug 30, 2015 at 3:13 PM, Eric Sunshine sunsh...@sunshineco.com wrote: On Sat, Aug 29, 2015 at 10:12 AM, Karthik Nayak karthik@gmail.com wrote: In 'tag.c' we can print N lines from the annotation of the tag using the '-nnum' option. Copy code from 'tag.c' to 'ref-filter' and modify

[PATCH v14 13/13] tag.c: implement '--merged' and '--no-merged' options

2015-08-29 Thread Karthik Nayak
it assumes HEAD as the object. Add documentation and tests for the same. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- Documentation/git-tag.txt | 7 ++- builtin/tag.c

[PATCH v14 04/13] ref-filter: implement an `align` atom

2015-08-29 Thread Karthik Nayak
@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- Documentation/git-for-each-ref.txt | 9 +++ ref-filter.c | 151 +++-- t/t6302-for-each-ref-filter.sh | 85 + 3 files changed, 221 insertions(+), 24

[PATCH v14 07/13] ref-filter: add support for %(contents:lines=X)

2015-08-29 Thread Karthik Nayak
are obtained. Add documentation and test for the same. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- Documentation/git-for-each-ref.txt | 1 + builtin/tag.c | 4

[PATCH v14 08/13] ref-filter: add support to sort by version

2015-08-29 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 tag -l` which

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

2015-08-29 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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' to use 'ref-filter' completely

[PATCH v14 11/13] tag.c: use 'ref-filter' APIs

2015-08-29 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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_refs()' function provided by 'ref

[PATCH v14 09/13] ref-filter: add option to match literal pattern

2015-08-29 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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

[PATCH v14 03/13] utf8: add function to align a string into given strbuf

2015-08-29 Thread Karthik Nayak
Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- utf8.c | 21 + utf8.h | 15 +++ 2 files changed, 36 insertions(+) diff --git a/utf8.c b/utf8.c index 28e6d76..00e10c8 100644 --- a/utf8.c +++ b/utf8.c @@ -644,3

[PATCH v14 00/13] Port tag.c to use ref-filter.c

2015-08-29 Thread Karthik Nayak
the first X lines from a given object. * Change code in 05/13 to make the code neater and consistent. * %(align) without arguments fails now. * Add test for nested alignment. * We perform quoting on each layer of nested alignment. Karthik Nayak (13): ref-filter: move `struct atom_value` to ref

[PATCH v14 01/13] ref-filter: move `struct atom_value` to ref-filter.c

2015-08-29 Thread Karthik Nayak
Since atom_value is only required for the internal working of ref-filter it doesn't belong in the public header. Helped-by: Eric Sunshine sunsh...@sunshineco.com Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik

[PATCH v14 02/13] ref-filter: introduce ref_formatting_state and ref_formatting_stack

2015-08-29 Thread Karthik Nayak
() - append_atom() emit()- append_literal() Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- ref-filter.c | 78 +--- 1 file

[PATCH v14 06/13] ref-filter: introduce format_ref_array_item()

2015-08-29 Thread Karthik Nayak
...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- ref-filter.c | 59 +-- ref-filter.h | 7 +-- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/ref

[PATCH v14 12/13] tag.c: implement '--format' option

2015-08-29 Thread Karthik Nayak
@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- Documentation/git-tag.txt | 8 +++- builtin/tag.c | 22 +- t/t7004-tag.sh| 12 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Documentation/git

[PATCH v14 05/13] ref-filter: add option to filter out tags, branches and remotes

2015-08-29 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com Add a function called 'for_each_fullref_in()' to refs.{c,h} which iterates through each ref for the given path without trimming the path and also accounting for broken refs, if mentioned. Add 'filter_ref_kind()' in ref-filter.c to check the kind of ref

Re: [PATCH v14 03/13] utf8: add function to align a string into given strbuf

2015-08-29 Thread Karthik Nayak
On Sat, Aug 29, 2015 at 10:40 PM, Torsten Bögershausen tbo...@web.de wrote: On 29.08.15 16:12, Karthik Nayak wrote: diff --git a/utf8.h b/utf8.h index 5a9e94b..7930b44 100644 --- a/utf8.h +++ b/utf8.h @@ -55,4 +55,19 @@ int mbs_chrlen(const char **text, size_t *remainder_p, const char

Re: [PATCH v13 05/12] ref-filter: add option to filter out tags, branches and remotes

2015-08-27 Thread Karthik Nayak
On Thu, Aug 27, 2015 at 8:54 PM, Michael Haggerty mhag...@alum.mit.edu wrote: On 08/27/2015 02:42 PM, Karthik Nayak wrote: On Wed, Aug 26, 2015 at 9:40 PM, Michael Haggerty mhag...@alum.mit.edu wrote: On 08/22/2015 05:39 AM, Karthik Nayak wrote: [...] + if (type == FILTER_REFS_BRANCHES

Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-27 Thread Karthik Nayak
On Thu, Aug 27, 2015 at 1:49 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: On Wed, Aug 26, 2015 at 8:07 PM, Junio C Hamano gits...@pobox.com wrote: ... You can give a new format_ref_array_item() that does not print but fills a strbuf to this caller

Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-26 Thread Karthik Nayak
of %(if:...)...%(end), be quoted. So you may see 'Empty' in the output. Agreed (with both points). Thanks, will work on this. -- 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

Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-26 Thread Karthik Nayak
On Wed, Aug 26, 2015 at 8:07 PM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: On Wed, Aug 26, 2015 at 12:46 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: I didn't check how wide the original is supposed

Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-26 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 11:26 PM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: I like the idea of using atomv-handler() a lot, mostly cause this would eventually help us clean up populate_atom() which currently seems like a huge dump of code. I think

Re: [RFC] Porting builtin/branch.c to use the printing options of ref-filter.{c,h}

2015-08-26 Thread Karthik Nayak
On Wed, Aug 26, 2015 at 12:20 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: I'm working on porting over the printing options of ref-filter to `git branch -l`. This is a follow up to http://article.gmane.org/gmane.comp.version-control.git/276377

Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-26 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 4:05 AM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: Karthik Nayak karthik@gmail.com writes: On Mon, Aug 24, 2015 at 10:57 PM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes

[RFC] Porting builtin/branch.c to use the printing options of ref-filter.{c,h}

2015-08-25 Thread Karthik Nayak
, but that might lead to a large format. Any suggestions? -- 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 v13 00/12] port tag.c to use ref-filter APIs

2015-08-25 Thread Karthik Nayak
On Wed, Aug 26, 2015 at 12:46 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: Here is what I see... ok 98 - verifying rfc1991 signature expecting success: echo rfc1991 gpghome/gpg.conf echo rfc1991-signed-tag RFC1991 signed tag

Re: [PATCH v13 02/12] ref-filter: introduce ref_formatting_state and ref_formatting_stack

2015-08-25 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 3:26 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: +static void push_new_stack_element(struct ref_formatting_stack **stack) +{ Micronit. Perhaps s/_new//;, as you do not call the other function pop_old_stack_element

Re: [PATCH v13 05/12] ref-filter: add option to filter out tags, branches and remotes

2015-08-25 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 3:54 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: From: Karthik Nayak karthik@gmail.com Add a function called 'for_each_reftype_fullpath()' to refs.{c,h} which iterates through each ref for the given path without trimming

Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-25 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 4:04 AM, Junio C Hamano gits...@pobox.com wrote: Matthieu Moy matthieu@grenoble-inp.fr writes: Karthik Nayak karthik@gmail.com writes: diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt index 1997657..06d468e 100644

Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-25 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 4:28 AM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: Matthieu Moy matthieu@grenoble-inp.fr writes: Karthik Nayak karthik@gmail.com writes: diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each

Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-25 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 3:43 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: +static void perform_quote_formatting(struct strbuf *s, const char *str, int quote_style); + +static void end_atom_handler(struct atom_value *atomv, struct

Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-25 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 12:23 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: On Mon, Aug 24, 2015 at 10:57 PM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: ... + performed. If used with '--quote' everything

Re: [PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-25 Thread Karthik Nayak
populate_atom() which currently seems like a huge dump of code. -- 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 v13 04/12] ref-filter: implement an `align` atom

2015-08-25 Thread Karthik Nayak
On Tue, Aug 25, 2015 at 3:45 AM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: Karthik Nayak karthik@gmail.com writes: +static void end_atom_handler(struct atom_value *atomv, struct ref_formatting_state *state) +{ +struct ref_formatting_stack

Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-24 Thread Karthik Nayak
On Mon, Aug 24, 2015 at 1:30 AM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt index 1997657..06d468e 100644 --- a/Documentation/git-for-each-ref.txt +++ b

Re: [PATCH v13 11/12] tag.c: implement '--format' option

2015-08-24 Thread Karthik Nayak
On Mon, Aug 24, 2015 at 8:44 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: On Mon, Aug 24, 2015 at 1:26 AM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: --- a/Documentation/git-tag.txt +++ b

Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-24 Thread Karthik Nayak
On Mon, Aug 24, 2015 at 8:46 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: On Mon, Aug 24, 2015 at 1:30 AM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: diff --git a/Documentation/git-for-each

Re: [PATCH v13 11/12] tag.c: implement '--format' option

2015-08-24 Thread Karthik Nayak
On Mon, Aug 24, 2015 at 1:26 AM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: --- a/Documentation/git-tag.txt +++ b/Documentation/git-tag.txt @@ -13,7 +13,8 @@ SYNOPSIS tagname [commit | object] 'git tag' -d tagname... 'git tag' [-n

Re: [PATCH v3 7/8] branch.c: use 'ref-filter' APIs

2015-08-24 Thread Karthik Nayak
On Mon, Aug 24, 2015 at 11:01 PM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: test_expect_success 'git branch shows badly named ref' ' cp .git/refs/heads/master .git/refs/heads/broken...ref test_when_finished rm -f .git/refs/heads

Re: [PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-24 Thread Karthik Nayak
On Mon, Aug 24, 2015 at 10:57 PM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: Interdiff: diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt index 1997657..06d468e 100644 --- a/Documentation/git-for-each-ref.txt

GSOC: Unify the commands `git tag -l`, `git brach -l` and `git for-each-ref`

2015-08-22 Thread Karthik Nayak
using its own implementation. As the ground has been laid for %(align)%(end) atom, the work shouldn't be of much difficulty. Will push most of my work to github: github.com/KarthikNayak/git -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line unsubscribe git in the body

Re: Which branch(es) contain certain commits? (was Re: (unknown))

2015-08-22 Thread Karthik Nayak
/276377 This is the current progress, the rest is in git/next. There is still a series of porting the printing part of branch.c to be done. -- 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

[PATCH v3 4/8] branch: move 'current' check down to the presentation layer

2015-08-22 Thread Karthik Nayak
-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- builtin/branch.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index 6ba7a3f..4d9e4d0 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -534,9 +534,10

[PATCH v3 5/8] branch: drop non-commit error reporting

2015-08-22 Thread Karthik Nayak
...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- builtin/branch.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index 4d9e4d0..8b9da60 100644 --- a/builtin

[PATCH v3 3/8] branch: roll show_detached HEAD into regular ref_list

2015-08-22 Thread Karthik Nayak
show_detached() used to check if the HEAD branch satisfies the '--contains' option, now that is taken care by append_ref(). Based-on-patch-by: Jeff King p...@peff.net Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak

[PATCH v3 0/8] port the filtering part of ref-filter to branch.c

2015-08-22 Thread Karthik Nayak
the no of array elements. * Karthik Nayak (8): branch: refactor width computation branch: bump get_head_description() to the top branch: roll show_detached HEAD into regular ref_list branch: move 'current' check down to the presentation layer branch: drop non-commit error reporting branch.c: use

[PATCH v3 2/8] branch: bump get_head_description() to the top

2015-08-22 Thread Karthik Nayak
Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- builtin/branch.c | 62 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index 28a10d6..193296a 100644

[PATCH v3 8/8] branch: add '--points-at' option

2015-08-22 Thread Karthik Nayak
-off-by: Karthik Nayak karthik@gmail.com --- Documentation/git-branch.txt | 6 +- builtin/branch.c | 7 ++- t/t3203-branch-output.sh | 9 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt

[PATCH v3 6/8] branch.c: use 'ref-filter' data structures

2015-08-22 Thread Karthik Nayak
...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- builtin/branch.c | 328 ++- ref-filter.c | 2 +- ref-filter.h | 9 +- 3 files changed, 141 insertions(+), 198

[PATCH v3 7/8] branch.c: use 'ref-filter' APIs

2015-08-22 Thread Karthik Nayak
-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- Documentation/git-branch.txt | 9 +- builtin/branch.c | 213 +++ ref-filter.c | 2 +- ref-filter.h | 1 - t/t1430

[PATCH v3 1/8] branch: refactor width computation

2015-08-22 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com Remove unnecessary variables from ref_list and ref_item which were used for width computation. This is to make ref_item similar to ref-filter's ref_array_item. This will ensure a smooth port of branch.c to use ref-filter APIs in further patches

Re: [PATCH v3 7/8] branch.c: use 'ref-filter' APIs

2015-08-22 Thread Karthik Nayak
On Sat, Aug 22, 2015 at 9:21 PM, Christian Couder christian.cou...@gmail.com wrote: On Sat, Aug 22, 2015 at 8:51 AM, Karthik Nayak karthik@gmail.com wrote: The test t1430 'git branch shows badly named ref' has been changed to check the stderr for the warning regarding the broken ref

[PATCH v13 09/12] tag.c: use 'ref-filter' data structures

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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' to use 'ref-filter' completely

[PATCH v13 12/12] tag.c: implement '--merged' and '--no-merged' options

2015-08-21 Thread Karthik Nayak
it assumes HEAD as the object. Add documentation and tests for the same. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- Documentation/git-tag.txt | 7 ++- builtin/tag.c

[PATCH v13 10/12] tag.c: use 'ref-filter' APIs

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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_refs()' function provided by 'ref

[PATCH v13 01/12] ref-filter: move `struct atom_value` to ref-filter.c

2015-08-21 Thread Karthik Nayak
Since atom_value is only required for the internal working of ref-filter it doesn't belong in the public header. Helped-by: Eric Sunshine sunsh...@sunshineco.com Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik

[PATCH v13 04/12] ref-filter: implement an `align` atom

2015-08-21 Thread Karthik Nayak
@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- Documentation/git-for-each-ref.txt | 9 +++ ref-filter.c | 124 ++--- t/t6302-for-each-ref-filter.sh | 69 + 3 files changed, 192 insertions(+), 10

[PATCH v13 03/12] utf8: add function to align a string into given strbuf

2015-08-21 Thread Karthik Nayak
Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- utf8.c | 21 + utf8.h | 15 +++ 2 files changed, 36 insertions(+) diff --git a/utf8.c b/utf8.c index 28e6d76..00e10c8 100644 --- a/utf8.c +++ b/utf8.c @@ -644,3

[PATCH v13 00/12] port tag.c to use ref-filter APIs

2015-08-21 Thread Karthik Nayak
(). * In tag.c support usage of --format with -nnum. Karthik Nayak (12): ref-filter: move `struct atom_value` to ref-filter.c ref-filter: introduce ref_formatting_state and ref_formatting_stack utf8: add function to align a string into given strbuf ref-filter: implement an `align` atom ref

[PATCH v13 02/12] ref-filter: introduce ref_formatting_state and ref_formatting_stack

2015-08-21 Thread Karthik Nayak
() - append_atom() emit()- append_literal() Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- ref-filter.c | 78 +--- 1 file

[PATCH v13 08/12] ref-filter: add option to match literal pattern

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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

[PATCH v13 07/12] ref-filter: add support to sort by version

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 tag -l` which

[PATCH v13 05/12] ref-filter: add option to filter out tags, branches and remotes

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com Add a function called 'for_each_reftype_fullpath()' to refs.{c,h} which iterates through each ref for the given path without trimming the path and also accounting for broken refs, if mentioned. Add 'filter_ref_kind()' in ref-filter.c to check the kind

[PATCH v13 11/12] tag.c: implement '--format' option

2015-08-21 Thread Karthik Nayak
@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- Documentation/git-tag.txt | 8 +++- builtin/tag.c | 19 +++ t/t7004-tag.sh| 12 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Documentation/git

[PATCH v13 06/12] ref-filter: support printing N lines from tag annotation

2015-08-21 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com In 'tag.c' we can print N lines from the annotation of the tag using the '-nnum' 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: Christian Couder

Re: [PATCH v12 03/13] ref-filter: introduce the ref_formatting_state stack machinery

2015-08-20 Thread Karthik Nayak
in your later messages, this is conceptually a global setting that applies to anybody working in the callchain and not something individual recursion levels would want to muck with. Thanks. I'll work on this :) -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line

Re: [PATCH v12 03/13] ref-filter: introduce the ref_formatting_state stack machinery

2015-08-20 Thread Karthik Nayak
On Thu, Aug 20, 2015 at 12:59 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: Speaking of quote_value, The quote doesn't work well with color's for e.g. git for-each-ref --shell --format=%(color:green)%(refname) '''refs/heads/allow-unknown

Re: [PATCH v12 05/13] ref-filter: implement an `align` atom

2015-08-20 Thread Karthik Nayak
On Fri, Aug 21, 2015 at 1:53 AM, Eric Sunshine sunsh...@sunshineco.com wrote: On Tue, Aug 18, 2015 at 2:37 PM, Karthik Nayak karthik@gmail.com wrote: Implement an `align` atom which left-, middle-, or right-aligns the content between %(align:..) and %(end). It is followed by `:width

Re: [PATCH v12 12/13] tag.c: implement '--format' option

2015-08-20 Thread Karthik Nayak
On Wed, Aug 19, 2015 at 8:23 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: --- a/Documentation/git-tag.txt +++ b/Documentation/git-tag.txt @@ -158,6 +159,18 @@ This option is only applicable when listing tags without annotation lines

<    2   3   4   5   6   7   8   9   10   11   >