Re: [PATCH v9 01/11] ref-filter: print output to strbuf for formatting

2015-08-06 Thread Karthik Nayak
On Fri, Aug 7, 2015 at 3:51 AM, Eric Sunshine sunsh...@sunshineco.com wrote: On Tue, Aug 4, 2015 at 8:42 AM, Karthik Nayak karthik@gmail.com wrote: Introduce a strbuf `output` which will act as a substitute rather than printing directly to stdout. This will be used for formatting

Re: [PATCH v9 02/11] ref-filter: introduce ref_formatting_state

2015-08-06 Thread Karthik Nayak
On Fri, Aug 7, 2015 at 5:49 AM, Eric Sunshine sunsh...@sunshineco.com wrote: On Tue, Aug 4, 2015 at 8:42 AM, Karthik Nayak karthik@gmail.com wrote: Introduce a ref_formatting_state which will eventually hold the values of modifier atoms. Implement this within ref-filter. Signed-off

[PATCH v9 03/11] ref-filter: implement an `align` atom

2015-08-05 Thread Karthik Nayak
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 | 8 ref-filter.c | 84 +++--- ref-filter.h

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

2015-08-04 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

[PATCH v9 02/11] ref-filter: introduce ref_formatting_state

2015-08-04 Thread Karthik Nayak
Introduce a ref_formatting_state which will eventually hold the values of modifier atoms. Implement this within ref-filter. 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

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

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

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

2015-08-04 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 v9 06/11] ref-filter: add support to sort by version

2015-08-04 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 v9 07/11] ref-filter: add option to match literal pattern

2015-08-04 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 v9 09/11] tag.c: use 'ref-filter' APIs

2015-08-04 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 v9 11/11] tag.c: implement '--merged' and '--no-merged' options

2015-08-04 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 only list tags not merged into the named

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

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

[PATCH v9 03/11] ref-filter: implement an `align` atom

2015-08-04 Thread Karthik Nayak
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 | 8 ref-filter.c | 84 +++--- ref-filter.h

[PATCH v9 0/11] Port tag.c over to use ref-filter APIs

2015-08-04 Thread Karthik Nayak
)%(align:middle,5)|%(refname)%(align:left,3)|%(refname) actual + git for-each-ref --format=|%(align:right,30)refname is %(refname)%(end)|%(refname) actual test_cmp expect actual ' -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line unsubscribe git in the body

[PATCH v9 01/11] ref-filter: print output to strbuf for formatting

2015-08-04 Thread Karthik Nayak
Introduce a strbuf `output` which will act as a substitute rather than printing directly to stdout. This will be used for formatting eventually. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik

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

2015-08-04 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 --- builtin/branch.c | 295

[PATCH 03/10] branch: bump get_head_description() to the top

2015-08-04 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 b058b74..65f6d0d 100644

[PATCH 05/10] branch: move 'current' check down to the presentation layer

2015-08-04 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 81815c9..c5f2944 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -534,9 +534,10

[PATCH 06/10] branch: drop non-commit error reporting

2015-08-04 Thread Karthik Nayak
Remove the error reporting variable to make the code easier to port over to using ref-filter APIs. 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

[PATCH 0/10] Port branch.c to ref-filter.

2015-08-04 Thread Karthik Nayak
as this was a split version and might as well be treated as the start of the patch series. -- 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 04/10] branch: roll show_detached HEAD into regular ref_list

2015-08-04 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 09/10] branch: add '--points-at' option

2015-08-04 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 08/10] branch.c: use 'ref-filter' APIs

2015-08-04 Thread Karthik Nayak
Signed-off-by: Karthik Nayak karthik@gmail.com --- Documentation/git-branch.txt | 9 +- builtin/branch.c | 219 --- ref-filter.c | 8 +- ref-filter.h | 1 - t/t1430-bad-ref-name.sh | 10 +- t/t3203

[PATCH 02/10] branch: refactor width computation

2015-08-04 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 0/10] Port branch.c to ref-filter.

2015-08-04 Thread Karthik Nayak
There are nine patches in the series. Have put 0/10 by mistake. -- 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 01/10] ref-filter: add option to filter only branches

2015-08-04 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 different types of branches by calling

Re: [PATCH v8 02/11] ref-filter: introduce ref_formatting_state

2015-08-03 Thread Karthik Nayak
On Tue, Aug 4, 2015 at 2:12 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: Introduce a ref_formatting_state which will eventually hold the values of modifier atoms. Implement this within ref-filter. Mentored-by: Christian Couder christian.cou

Re: [PATCH v8 0/11] Port tag.c over to use ref-filter APIs

2015-08-03 Thread Karthik Nayak
On Tue, Aug 4, 2015 at 3:38 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: On Tue, Aug 4, 2015 at 1:51 AM, Junio C Hamano gits...@pobox.com wrote: ... It is very very dissapointing to allow the next atom only implementation to squat on a good name

Re: [PATCH v8 01/11] ref-filter: print output to strbuf for formatting

2015-08-03 Thread Karthik Nayak
On Tue, Aug 4, 2015 at 2:06 AM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: Introduce a strbuf `output` which will act as a substitute rather than printing directly to stdout. This will be used for formatting eventually. --- Missing sign-off

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

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

Re: [PATCH v7 0/11] port tag.c to use ref-filter APIs

2015-08-03 Thread Karthik Nayak
On Sun, Aug 2, 2015 at 11:02 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: +test_expect_success 'no padding when `padright` length is smaller than atom length' ' +cat expect -\EOF +refs/heads/master| +refs/heads/side

[PATCH v8 0/11] Port tag.c over to use ref-filter APIs

2015-08-03 Thread Karthik Nayak
| refs/tags/three| refs/tags/three +||two | refs/tags/two| refs/tags/two +EOF +git for-each-ref --format=|%(align:right,5)|%(refname:short)%(align:middle,5)|%(refname)%(align:left,3)|%(refname) actual test_cmp expect actual ' -- Regards, Karthik Nayak -- To unsubscribe

[PATCH v8 03/11] ref-filter: implement an `align` atom

2015-08-03 Thread Karthik Nayak
-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- Documentation/git-for-each-ref.txt | 7 ref-filter.c | 69 +--- ref-filter.h | 12 ++ t/t6302-for-each-ref-filter.sh | 80

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

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

[PATCH v8 01/11] ref-filter: print output to strbuf for formatting

2015-08-03 Thread Karthik Nayak
Introduce a strbuf `output` which will act as a substitute rather than printing directly to stdout. This will be used for formatting eventually. --- ref-filter.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ref-filter.c b/ref-filter.c

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

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

[PATCH v8 02/11] ref-filter: introduce ref_formatting_state

2015-08-03 Thread Karthik Nayak
Introduce a ref_formatting_state which will eventually hold the values of modifier atoms. Implement this within ref-filter. 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

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

2015-08-03 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 v8 06/11] ref-filter: add support to sort by version

2015-08-03 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 v8 09/11] tag.c: use 'ref-filter' APIs

2015-08-03 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 v8 05/11] ref-filter: support printing N lines from tag annotation

2015-08-03 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

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

2015-08-03 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 only list tags not merged into the named

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

2015-08-02 Thread Karthik Nayak
On Sat, Aug 1, 2015 at 2:33 PM, Eric Sunshine sunsh...@sunshineco.com wrote: On Sat, Aug 1, 2015 at 2:48 AM, Karthik Nayak karthik@gmail.com wrote: On Thu, Jul 30, 2015 at 2:57 AM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Good point! I just was wondering if we need another atom

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

2015-08-01 Thread Karthik Nayak
On Wed, Jul 29, 2015 at 11:30 PM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: A handful of huh? on the design. - The atom says if *exists* and explanation says has a value. How are they related? Does an atom whose value is an empty string has

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

2015-08-01 Thread Karthik Nayak
the need for escaping since the content of the if/endif is a format string like the others, it can use the same escaping rules (IIRC, %% to escape a %). THat's a really good point. Will work on this :) -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line unsubscribe git

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

2015-08-01 Thread Karthik Nayak
On Thu, Jul 30, 2015 at 2:57 AM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: What I was thinking of was something like this : struct strbuf format = STRBUF_INIT; char c = ' '; if (current) c = '*'; strbuf_addf(format, %c, c, other

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

2015-08-01 Thread Karthik Nayak
the %(refname:short) at the front of the pattern, as you currently have it, if you want to prove that padding is not enabled at the start of format. Thanks Eric. This seems like a better improvement over my test. Will implement this :) -- Regards, Karthik Nayak -- To unsubscribe from this list: send

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

2015-08-01 Thread Karthik Nayak
their result. Both %(if) and the hypotherical %(align) can use this same diversion mechanism. And the above would properly nest, e.g. %(align:middle,40)%(if:taggerdate)tag %(end)%(refname:short)%(end) This actually looks neat and good, I'll try implementing this :) -- Regards, Karthik Nayak

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

2015-07-30 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 only list tags not merged into the named

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

2015-07-30 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 v7 0/11] port tag.c to use ref-filter APIs

2015-07-30 Thread Karthik Nayak
| +refs/tags/one| +refs/tags/signed-tag| +refs/tags/three| +refs/tags/two| +EOF +git for-each-ref --format=%(padright:5)%(refname)| actual test_cmp expect actual ' Thanks to Everyone for suggestions and tips :) -- Regards, Karthik Nayak -- To unsubscribe from this list

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

2015-07-30 Thread Karthik Nayak
...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- ref-filter.c | 70 ref-filter.h | 5 + 2 files changed, 57 insertions(+), 18 deletions(-) diff --git a/ref

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

2015-07-30 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 v7 10/11] tag.c: implement '--format' option

2015-07-30 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 christian.cou

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

2015-07-30 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 v7 02/11] ref-filter: make `color` use `ref_formatting_state`

2015-07-30 Thread Karthik Nayak
Signed-off-by: Karthik Nayak karthik@gmail.com --- ref-filter.c | 10 -- ref-filter.h | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index d6510a6..9a63d25 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -662,6 +662,8 @@ static void

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

2015-07-30 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 v6 01/10] ref-filter: introduce 'ref_formatting_state'

2015-07-30 Thread Karthik Nayak
On Thu, Jul 30, 2015 at 12:49 AM, Eric Sunshine sunsh...@sunshineco.com wrote: On Tuesday, July 28, 2015, Karthik Nayak karthik@gmail.com wrote: Introduce 'ref_formatting' structure to hold values of pseudo atoms which help only in formatting. This will eventually be used by atoms like

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

2015-07-30 Thread Karthik Nayak
. Helped-by: Duy Nguyen pclo...@gmail.com Helped-by: Junio C Hamano gits...@pobox.com 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 | 6

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

2015-07-30 Thread Karthik Nayak
Signed-off-by: Karthik Nayak karthik@gmail.com --- ref-filter.c | 10 -- ref-filter.h | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index d6510a6..9a63d25 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -662,6 +662,8 @@ static void

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

2015-07-30 Thread Karthik Nayak
...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- ref-filter.c | 70 ref-filter.h | 5 + 2 files changed, 57 insertions(+), 18 deletions(-) diff --git a/ref

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

2015-07-30 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

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

2015-07-30 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

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

2015-07-30 Thread Karthik Nayak
On Wed, Jul 29, 2015 at 9:26 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: On Tue, Jul 28, 2015 at 7:47 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: I'm not sure what's the convention, but I think the test description should give

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

2015-07-30 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 christian.cou

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

2015-07-30 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 v7 06/11] ref-filter: add support to sort by version

2015-07-30 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 v7 03/11] ref-filter: add option to pad atoms to the right

2015-07-30 Thread Karthik Nayak
. Helped-by: Duy Nguyen pclo...@gmail.com Helped-by: Junio C Hamano gits...@pobox.com 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 | 6

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

2015-07-30 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 by adding

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

2015-07-30 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 v7 11/11] tag.c: implement '--merged' and '--no-merged' options

2015-07-30 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 only list tags not merged into the named

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

2015-07-30 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

[GSOC] Update 5: Unification of tag -l, branch -l and for-each-ref

2015-07-30 Thread Karthik Nayak
/KarthikNayak/git -- 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: [GSOC] Update 5: Unification of tag -l, branch -l and for-each-ref

2015-07-30 Thread Karthik Nayak
This is update 6 :D -- 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 v6 0/10] port tag.c to use ref-filter APIs

2015-07-30 Thread Karthik Nayak
. -- 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 v6 02/10] ref-filter: add option to pad atoms to the right

2015-07-30 Thread Karthik Nayak
On Thu, Jul 30, 2015 at 12:59 AM, Eric Sunshine sunsh...@sunshineco.com wrote: On Tuesday, July 28, 2015, Karthik Nayak karthik@gmail.com 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 spaces

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

2015-07-30 Thread Karthik Nayak
On Thu, Jul 30, 2015 at 1:04 AM, Eric Sunshine sunsh...@sunshineco.com wrote: On Tuesday, July 28, 2015, Karthik Nayak karthik@gmail.com wrote: Add support to sort by version using the v:refname and version:refname option. This is achieved by using the 'versioncmp()' function

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

2015-07-30 Thread Karthik Nayak
the blue thing again). This makes sense, will work on this thanks :) -- 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 07/11] ref-filter: add option to match literal pattern

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

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 matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: On Tue, Jul 28, 2015 at 7:05 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Ideally, you could also have a modifier atom %(alignleft) [...] This could work

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 matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: @@ -458,7 +345,7 @@ static void add_verbose_info(struct strbuf *out, struct ref_array_item *item

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 gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: From: Karthik Nayak karthik@gmail.com Add support for %(objectname:size=X) where X is a number. This will print the first X characters of an objectname. The minimum value

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 matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: -static void print_value(struct atom_value *v, int quote_style) +static void apply_formatting_state(struct ref_formatting_state *state

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 sunsh...@sunshineco.com wrote: On Mon, Jul 27, 2015 at 3:27 AM, Karthik Nayak karthik@gmail.com wrote: From: Karthik Nayak karthik@gmail.com Since 'ref-filter' only has an option to match path names add an option for plain fnmatch pattern

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 sunsh...@sunshineco.com wrote: On Mon, Jul 27, 2015 at 3:27 AM, Karthik Nayak karthik@gmail.com 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

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

2015-07-29 Thread Karthik Nayak
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 unsubscribe git in the body of a message

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 jacob.kel...@gmail.com wrote: On Tue, Jul 28, 2015 at 12:11 AM, Karthik Nayak karthik@gmail.com 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. Add

Re: [PATCH] ref-filter: fix indentation

2015-07-29 Thread 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 Thanks for this :) -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line unsubscribe git in the body

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 3:31 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: On Tue, Jul 28, 2015 at 6:39 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: We check if given ref is the current

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 gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com 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.g

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

2015-07-29 Thread Karthik Nayak
On Wed, Jul 29, 2015 at 3:38 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: On Tue, Jul 28, 2015 at 7:18 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Christian Couder christian.cou...@gmail.com writes: On Tue, Jul 28, 2015 at 8:56 AM

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 jacob.kel...@gmail.com wrote: On Tue, Jul 28, 2015 at 1:12 PM, Karthik Nayak karthik@gmail.com wrote: On Tue, Jul 28, 2015 at 6:39 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: We check

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 matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: On Tue, Jul 28, 2015 at 6:31 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: -static void show_detached(struct ref_list *ref_list, int maxwidth

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

2015-07-28 Thread Karthik Nayak
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

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

2015-07-28 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 --- builtin/branch.c | 289

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

2015-07-28 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 p...@peff.net Mentored

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

2015-07-28 Thread Karthik Nayak
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 | 5 + ref-filter.c | 20 +++- ref-filter.h | 4

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

2015-07-28 Thread Karthik Nayak
...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- builtin/branch.c | 122 --- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/builtin/branch.c b/builtin

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

2015-07-28 Thread Karthik Nayak
-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 | 8 ref-filter.c | 37 ++--- ref-filter.h

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

2015-07-28 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com 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 different types of branches by calling

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