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

2015-09-21 Thread Karthik Nayak
On Mon, Sep 21, 2015 at 3:50 PM, Karthik Nayak <karthik@gmail.com> wrote: > On Mon, Sep 21, 2015 at 12:46 AM, Matthieu Moy > <matthieu@grenoble-inp.fr> wrote: >> Karthik Nayak <karthik@gmail.com> writes: >> >>> Remove the error repor

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

2015-09-20 Thread Karthik Nayak
of the code introduced here will be removed when 'branch.c' is ported over to use 'ref-filter' APIs. Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- buil

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

2015-09-20 Thread Karthik Nayak
@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-branch.txt | 9 +- builtin/branch.c | 212 +++ ref-filter.c | 2 +- ref-filter.h | 1 - t/t1430-bad-ref-

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

2015-09-20 Thread Karthik Nayak
the detached head at the end of the array and printing it initially. * Fix broken tests. 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

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

2015-09-20 Thread Karthik Nayak
gt; Mentored-by: Matthieu 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.

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

2015-09-20 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 p

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

2015-09-20 Thread Karthik Nayak
stian.cou...@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

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

2015-09-20 Thread Karthik Nayak
le-inp.fr> Signed-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

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

2015-09-20 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> Sign

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

2015-09-20 Thread Karthik Nayak
instead. 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 <karthik@gmail.com> --- builtin/branch.c | 20 +--

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

2015-09-18 Thread Karthik Nayak
in > which case it defaults to `HEAD`. > This seems good to be included. > I also had a look at git-branch(1), which has similar `--merged` and > `--no-merged` options and says: > > Only list branches whose tips are reachable from the specified >

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

2015-09-18 Thread Karthik Nayak
On Fri, Sep 18, 2015 at 8:49 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> Not sure this is much of a problem with regards to "--[no-]merged" >> I mean isn't the square brackets self-explanatory?

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

2015-09-18 Thread Karthik Nayak
On Fri, Sep 18, 2015 at 9:00 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> On Fri, Sep 18, 2015 at 8:49 PM, Matthieu Moy >> <matthieu@grenoble-inp.fr> wrote: >>> Karthik Nayak <

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

2015-09-17 Thread Karthik Nayak
On Wed, Sep 16, 2015 at 11:53 AM, Karthik Nayak <karthik@gmail.com> wrote: > On Tue, Sep 15, 2015 at 1:05 AM, Junio C Hamano <gits...@pobox.com> wrote: >> Karthik Nayak <karthik@gmail.com> writes: >> >>> + /* >>> + * Firs

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

2015-09-17 Thread Karthik Nayak
EAD detached at ...) > master > > which seems weird to me. But we can decide "if sorting on refname, then > HEAD always comes first anyway". Thanks for explaining what I had in mind, Seems like the confusion is sorted, I have nothing more to add to this discussion. Junio is r

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

2015-09-16 Thread Karthik Nayak
On Tue, Sep 15, 2015 at 1:19 AM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> Remove the error reporting variable to make the code easier to port >> over to using ref-filter APIs. This variable is not required as in

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

2015-09-16 Thread Karthik Nayak
On Tue, Sep 15, 2015 at 1:05 AM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> + /* >> + * First we obtain all regular branch refs and if the HEAD is >> + * detached then we insert that ref to th

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

2015-09-14 Thread Karthik Nayak
On Mon, Sep 14, 2015 at 12:01 AM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Sun, Sep 13, 2015 at 12:46 PM, Eric Sunshine <sunsh...@sunshineco.com> > wrote: >> On Sun, Sep 13, 2015 at 8:12 AM, Matthieu Moy >> <matthieu@grenoble-inp.fr> wrote: >

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

2015-09-13 Thread Karthik Nayak
On Sun, Sep 13, 2015 at 12:53 PM, Karthik Nayak <karthik@gmail.com> 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. > >

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

2015-09-13 Thread Karthik Nayak
ntored-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

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

2015-09-13 Thread Karthik Nayak
stian.cou...@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

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

2015-09-13 Thread Karthik Nayak
eu@grenoble-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/bu

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

2015-09-13 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> Sign

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

2015-09-13 Thread Karthik Nayak
gt; Mentored-by: Matthieu 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.

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

2015-09-13 Thread Karthik Nayak
The changes in this version are: [7/8]: Change the tests check for stdout and stderr. (check interdiff) 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

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

2015-09-13 Thread Karthik Nayak
<christian.cou...@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 chang

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

2015-09-13 Thread Karthik Nayak
ntored-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

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

2015-09-13 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 p

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

2015-09-13 Thread Karthik Nayak
le-inp.fr> Signed-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

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

2015-09-13 Thread Karthik Nayak
On Sun, Sep 13, 2015 at 5:45 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> 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 b

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

2015-09-13 Thread Karthik Nayak
On Sun, Sep 13, 2015 at 5:42 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> @@ -679,15 +682,20 @@ static int print_ref_list(int kinds, int detached, int >> verbose, int abbrev, stru >> if

Re: [PATCH v4 1/8] branch: refactor width computation

2015-09-13 Thread Karthik Nayak
On Sun, Sep 13, 2015 at 5:21 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> @@ -667,26 +675,22 @@ static int print_ref_list(int kinds, int detached, int >> verbose, int abbrev, stru >>

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

2015-09-13 Thread Karthik Nayak
On Sun, Sep 13, 2015 at 5:56 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> /* Print detached HEAD before sorting and printing the rest */ >> - if (detached) { >> - print_ref_

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

2015-09-13 Thread Karthik Nayak
instead. 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 <karthik@gmail.com> --- Change the commit message to explain

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

2015-09-12 Thread Karthik Nayak
On Sat, Sep 12, 2015 at 2:44 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> On Thu, Sep 10, 2015 at 10:27 PM, Matthieu Moy >> <matthieu@grenoble-inp.fr> wrote: >>> Karthik Nayak <kart

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

2015-09-11 Thread Karthik Nayak
om_name(const char *name, const char *atom_name, const char * if (!skip_prefix(name, atom_name, )) return 0; /* doesn't even begin with "atom_name" */ -if (!body[0] || !body[1]) { +if (!body[0]) { *val = NULL; /* %(atom_name) and no customization */ return 1; } @@ -899,6 +895,7 @@ static void populate_value(struct ref_array_item *ref) align->position = ALIGN_LEFT; while (*s) { +/* Strip trailing comma */ if (s[1]) strbuf_setlen(s[0], s[0]->len - 1); if (!strtoul_ui(s[0]->buf, 10, (unsigned int *))) -- 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 v17 06/14] ref-filter: implement an `align` atom

2015-09-11 Thread Karthik Nayak
by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Helped-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 11 ++

[PATCH v17 06/14] ref-filter: implement an `align` atom

2015-09-11 Thread Karthik Nayak
by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Helped-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 11 ++

[PATCH v17 05/14] ref-filter: introduce match_atom_name()

2015-09-11 Thread Karthik Nayak
cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Thanks-to: Junio C Hamano <gits...@pobox.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- ref-filter.c | 23 +-- t/t6302-for-each-ref-filter.sh | 4 +

[PATCH v17 08/14] ref-filter: add support for %(contents:lines=X)

2015-09-11 Thread Karthik Nayak
. While we're at it, remove unused "contents:" atoms from the `valid_atom` array. 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

[PATCH v17 12/14] tag.c: use 'ref-filter' APIs

2015-09-11 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 v17 13/14] tag.c: implement '--format' option

2015-09-11 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 | 24 ++-- t/t7004-tag.sh| 12 3 files changed, 33 insertions(+), 11 deleti

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

2015-09-11 Thread Karthik Nayak
On Thu, Sep 10, 2015 at 10:27 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> This is part of the series of unifying the code used by >> "git tag -l, git branch -l, git for-each-ref". >> >

[PATCH v17 00/14] port tag.c to use ref-filter APIs

2015-09-10 Thread Karthik Nayak
changeable. * Small grammatical changes. * Small changes in the tests to reflect changes in the align atom code. Karthik Nayak (14): 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

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

2015-09-10 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 v17 08/14] ref-filter: add support for %(contents:lines=X)

2015-09-10 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 v17 04/14] ref-filter: introduce handler function for each atom

2015-09-10 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 v17 06/14] ref-filter: implement an `align` atom

2015-09-10 Thread Karthik Nayak
by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Helped-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 11 ++

[PATCH v17 09/14] ref-filter: add support to sort by version

2015-09-10 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 v17 02/14] ref-filter: introduce ref_formatting_state and ref_formatting_stack

2015-09-10 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 v17 10/14] ref-filter: add option to match literal pattern

2015-09-10 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 v17 07/14] ref-filter: add option to filter out tags, branches and remotes

2015-09-10 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 v17 05/14] ref-filter: introduce match_atom_name()

2015-09-10 Thread Karthik Nayak
cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Thanks-to: Junio C Hamano <gits...@pobox.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- ref-filter.c | 23 +-- t/t6302-for-each-ref-filter.sh | 4 +

[PATCH v17 12/14] tag.c: use 'ref-filter' APIs

2015-09-10 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 v17 14/14] tag.c: implement '--merged' and '--no-merged' options

2015-09-10 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

[PATCH v17 13/14] tag.c: implement '--format' option

2015-09-10 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 | 24 ++-- t/t7004-tag.sh| 12 3 files changed, 33 insertions(+), 11 deleti

Re: [PATCH v17 05/14] ref-filter: introduce match_atom_name()

2015-09-10 Thread Karthik Nayak
On Thu, Sep 10, 2015 at 10:26 PM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> Introduce match_atom_name() which helps in checking if a particular >> atom is the atom we're looking for and if it has a value attac

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

2015-09-10 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

Re: [PATCH v17 13/14] tag.c: implement '--format' option

2015-09-10 Thread Karthik Nayak
On Thu, Sep 10, 2015 at 11:29 PM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> -static int list_tags(struct ref_filter *filter, struct ref_sorting *sorting) >> +static int list_tags(struct ref_filter *filter, struct r

Re: [PATCH v17 05/14] ref-filter: introduce match_atom_name()

2015-09-10 Thread Karthik Nayak
On Thu, Sep 10, 2015 at 10:58 PM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> The check was for checking if there is anything after the colon, > > Why do you even care? If %(color) expects more specific > custo

Re: [PATCH v17 05/14] ref-filter: introduce match_atom_name()

2015-09-10 Thread Karthik Nayak
On Thu, Sep 10, 2015 at 11:15 PM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> It is one thing that the user can actually do the check themselves, >> but doesn't it make more sense that when we're using co

Re: [PATCH v17 08/14] ref-filter: add support for %(contents:lines=X)

2015-09-10 Thread Karthik Nayak
On Thu, Sep 10, 2015 at 10:44 PM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> diff --git a/ref-filter.c b/ref-filter.c >> index 7d2732a..b098b16 100644 >> --- a/ref-filter.c >> +++ b/ref-f

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

2015-09-09 Thread Karthik Nayak
gt;> to_free = format; >> >> (still 83 columns + indentation, but that's a bit shorter than your >> version). > > Sure. This may also be possible > > xstrfmt("%s %%(contents:lines=%d)", > "%(align:15,left)%(refname:short)

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

2015-09-07 Thread Karthik Nayak
On Mon, Sep 7, 2015 at 12:03 PM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> diff --git a/Documentation/git-for-each-ref.txt >> b/Documentation/git-for-each-ref.txt >> index d039f40..c5154bb 100644 >>

Re: [PATCH v16 05/14] ref-filter: introduce match_atom_name()

2015-09-07 Thread Karthik Nayak
On Mon, Sep 7, 2015 at 1:22 AM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Sat, Sep 5, 2015 at 2:52 PM, Karthik Nayak <karthik@gmail.com> wrote: >> Introduce match_atom_name() which helps in checking if a particular >> atom is the atom we're looking for and

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

2015-09-07 Thread Karthik Nayak
On Mon, Sep 7, 2015 at 7:35 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> On Mon, Sep 7, 2015 at 12:03 PM, Junio C Hamano <gits...@pobox.com> wrote: >>>> diff --git a/builtin/tag.c b/builti

Re: [PATCH v16 06/14] ref-filter: implement an `align` atom

2015-09-07 Thread Karthik Nayak
On Mon, Sep 7, 2015 at 1:40 AM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Sat, Sep 5, 2015 at 2:52 PM, Karthik Nayak <karthik@gmail.com> wrote: >> Implement an `align` atom which left-, middle-, or right-aligns the >> content between %(align:...) and %

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

2015-09-06 Thread Karthik Nayak
On Mon, Sep 7, 2015 at 12:19 AM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> @@ -705,9 +719,12 @@ static void grab_sub_body_contents(struct atom_value >> *val, int deref, struct obj >>

Re: [PATCH] tag: support mixing --sort= and -n

2015-09-05 Thread Karthik Nayak
rebasing this on top of Karthik's part tag > to use ref-filter series, since I think there will be plenty of merge > conflicts there... > Its already resolved in my series. We use ref-filter's sorting APIs there :) -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line

[PATCH v16 12/14] tag.c: use 'ref-filter' APIs

2015-09-05 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 v16 04/14] ref-filter: introduce handler function for each atom

2015-09-05 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 v16 02/14] ref-filter: introduce ref_formatting_state and ref_formatting_stack

2015-09-05 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 v16 11/14] tag.c: use 'ref-filter' data structures

2015-09-05 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 v16 09/14] ref-filter: add support to sort by version

2015-09-05 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 v16 07/14] ref-filter: add option to filter out tags, branches and remotes

2015-09-05 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 v16 13/14] tag.c: implement '--format' option

2015-09-05 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

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

2015-09-05 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 v16 00/14] port tag.c to use ref-filter APIs

2015-09-05 Thread Karthik Nayak
() for checking atom names. Karthik Nayak (14): 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 atom ref-filter

[PATCH v16 06/14] ref-filter: implement an `align` atom

2015-09-05 Thread Karthik Nayak
com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 10 ref-filter.c | 112 - t/t6302-for-each-ref-filter.sh | 82 ++

[PATCH v16 08/14] ref-filter: add support for %(contents:lines=X)

2015-09-05 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 v16 05/14] ref-filter: introduce match_atom_name()

2015-09-05 Thread Karthik Nayak
cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Thanks-to: Junio C Hamano <gits...@pobox.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- ref-filter.c | 23 +-- t/t6302-for-each-ref-filter.sh | 4 +

[PATCH v16 10/14] ref-filter: add option to match literal pattern

2015-09-05 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 v16 14/14] tag.c: implement '--merged' and '--no-merged' options

2015-09-05 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 07/13] ref-filter: add support for %(contents:lines=X)

2015-09-04 Thread Karthik Nayak
in the sense that it is > guaranteed not to go on forever, but you need to verify the location > of the string it found is within the bounds. That was the idea behind this, but will stick to Matthieu's suggestion. -- Regards, Karthik Nayak -- To unsubscribe from this list: sen

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

2015-09-04 Thread Karthik Nayak
On Thu, Sep 3, 2015 at 9:53 PM, Junio C Hamano <gits...@pobox.com> wrote: > Eric Sunshine <sunsh...@sunshineco.com> writes: > >> On Tue, Sep 1, 2015 at 2:26 PM, Karthik Nayak <karthik@gmail.com> wrote: >>> Implement an `align` atom which left-, middle-,

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

2015-09-03 Thread Karthik Nayak
On Thu, Sep 3, 2015 at 7:04 PM, Karthik Nayak <karthik@gmail.com> wrote: >> struct strbuf s = STRBUF_INIT; >> if (strtoul_ui(valp, 10, >u.contents.lines)) >> die(_("positive widt

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

2015-09-03 Thread Karthik Nayak
On Thu, Sep 3, 2015 at 8:17 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> On Thu, Sep 3, 2015 at 7:04 PM, Karthik Nayak <karthik@gmail.com> wrote: >>>>

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

2015-09-03 Thread Karthik Nayak
ich > I like even more after this discussion ;-). Yes, your suggestion seems like a good way to go. -- 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 v15 07/13] ref-filter: add support for %(contents:lines=X)

2015-09-03 Thread Karthik Nayak
On Thu, Sep 3, 2015 at 8:09 PM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Tue, Sep 1, 2015 at 2:26 PM, Karthik Nayak <karthik@gmail.com> wrote: >> In 'tag.c' we can print N lines from the annotation of the tag using >> the '-n' option. Copy code

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

2015-09-03 Thread Karthik Nayak
On Thu, Sep 3, 2015 at 7:42 PM, Eric Sunshine <sunsh...@sunshineco.com> wrote: > On Tue, Sep 1, 2015 at 2:26 PM, Karthik Nayak <karthik@gmail.com> wrote: >> Implement an `align` atom which left-, middle-, or right-aligns the >> content between %(align:..) and %(

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

2015-09-03 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 10:58 PM, Junio C Hamano <gits...@pobox.com> wrote: > Matthieu Moy <matthieu@grenoble-inp.fr> writes: > >> Junio C Hamano <gits...@pobox.com> writes: >> >>> Karthik Nayak <karthik@gmail.com> writes: >>&g

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

2015-09-03 Thread Karthik Nayak
gt; > FWIW, I too find the "15-col followed by a space" easier to > understand. I was merely being curious when/why Karthik changed > preference, not objecting to the actual choice. > I'm surprised you recall that from memory :D -- Regards, Karthik Nayak -- To unsubs

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

2015-09-03 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 9:41 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> On Wed, Sep 2, 2015 at 2:37 PM, Matthieu Moy >> <matthieu@grenoble-inp.fr> wrote: >>> Karthik Nayak <karth

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

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 9:15 PM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> On Wed, Sep 2, 2015 at 8:31 PM, Junio C Hamano <gits...@pobox.com> wrote: >>> Karthik Nayak <karthik@gmail.com> writes:

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

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 8:40 PM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> + if (filter->lines) >> + format = to_free = >> xstrfmt("%%(align:15,left)%

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

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 2:49 AM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> We have an `at_end` function for each element of the stack which is to >> be called when the `end` atom is encountered. Using this we

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

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 2:11 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> +test_expect_success 'alignment with format quote' ' >> + cat >expect <<-EOF && >> + refname is ${

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

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 2:15 PM, Matthieu Moy <matthieu@grenoble-inp.fr> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> --- a/ref-filter.c >> +++ b/ref-filter.c > >> @@ -163,9 +174,28 @@ static void quote_formatting(struct strbuf *

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

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 9:45 AM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >>>> + if (filter->kind == FILTER_REFS_BRANCHES) >>>> + ret = for_each_fullref_in("refs

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

2015-09-02 Thread Karthik Nayak
On Wed, Sep 2, 2015 at 8:31 PM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >>>> + die(_("format: `end` atom used without a supporting atom")); >>> >>> Not a show-stopper, but we m

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