[PATCH v4 13/16] ref-filter: allow porcelain to translate messages in the output

2016-04-09 Thread Karthik Nayak
ned-off-by: Karthik Nayak --- ref-filter.c | 28 ref-filter.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 73e0a7f..3435df1 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -15,6 +15,26 @@ #include

[PATCH v4 04/16] ref-filter: modify "%(objectname:short)" to take length

2016-04-09 Thread Karthik Nayak
s unique. Add tests and documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Helped-by: Jacob Keller Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 4 ref-filter.c | 25 +++-- t/t

[PATCH v4 09/16] ref-filter: make "%(symref)" atom work with the ':short' modifier

2016-04-09 Thread Karthik Nayak
%(symref:short) while we're here. Helped-by: Junio C Hamano Signed-off-by: Karthik Nayak --- ref-filter.c| 2 +- t/t6300-for-each-ref.sh | 24 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ref-filter.c b/ref-filter.c index 8c97cdb..5c

[PATCH v4 11/16] ref-filter: introduce refname_atom_parser()

2016-04-09 Thread Karthik Nayak
Introduce refname_atom_parser() which will parse the '%(refname)' atom and store information into the 'used_atom' structure based on the modifiers used along with the atom. Signed-off-by: Karthik Nayak --- ref-filter.c | 70 +---

[PATCH v4 15/16] branch: use ref-filter printing APIs

2016-04-09 Thread Karthik Nayak
reflect these changes. Change calc_maxwidth() to also account for the length of HEAD ref, by calling ref-filter:get_head_discription(). Also change the test in t6040 to reflect the changes. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c

[PATCH v4 10/16] ref-filter: introduce symref_atom_parser()

2016-04-09 Thread Karthik Nayak
Introduce symref_atom_parser() which will parse the '%(symref)' atom and store information into the 'used_atom' structure based on the modifiers used along with the atom. Signed-off-by: Karthik Nayak --- ref-filter.c | 25 +++-- 1 file changed, 23 insert

[PATCH v4 07/16] ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams

2016-04-09 Thread Karthik Nayak
each-ref.sh and Documentation/git-for-each-ref.txt to reflect this change. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Helped-by : Jacob Keller Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 3 ++- ref-filter.c | 4 +++- t/t6300-

[PATCH v4 12/16] ref-filter: add support for %(refname:dir) and %(refname:base)

2016-04-09 Thread Karthik Nayak
the same. Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 4 +++- ref-filter.c | 28 +--- t/t6300-for-each-ref.sh| 2 ++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Documentation/git-for-each

[PATCH v4 02/16] ref-filter: include reference to 'used_atom' within 'atom_value'

2016-04-09 Thread Karthik Nayak
therefore removing the necessity of passing %(align) atom's parameters to 'atom_value'. This also acts as a preparatory patch for the upcoming patch where we introduce %(if:equals=) and %(if:notequals=). Signed-off-by: Karthik Nayak --- ref-filter.c | 8 +++- 1 file changed, 3 in

[PATCH v4 00/16] port branch.c to use ref-filter's printing options

2016-04-09 Thread Karthik Nayak
hanks to Dennis Kaarsemaker and Ramsay Jones for reporting this in. 2. Show local branch symrefs if available, changed this in the format for `git branch -l`. Thanks to Junio, Matthieu, Dennis and Ramsay for all suggestions on the previous iteration. Karthik Nayak (16): ref-filter: implement %(if), %(th

[PATCH v4 05/16] ref-filter: move get_head_description() from branch.c

2016-04-09 Thread Karthik Nayak
HEAD refs description in branch.c:calc_maxwidth() when we port branch.c to use ref-filter APIs. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 31 --- ref-filter.c | 38

[PATCH v4 03/16] ref-filter: implement %(if:equals=) and %(if:notequals=)

2016-04-09 Thread Karthik Nayak
and Documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 3 +++ ref-filter.c | 43 +- t/t6302-for-each-ref-filter.sh | 18 +++

[PATCH v4 01/16] ref-filter: implement %(if), %(then), and %(else) atoms

2016-04-09 Thread Karthik Nayak
-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 45 +++-- ref-filter.c | 133 +++-- t/t6302-for-each-ref-filter.sh | 76 + 3 files changed, 243 insertions(+), 11 deletions(-) diff --git a

Re: [PATCH] branch: fix shortening of non-remote symrefs

2016-04-04 Thread Karthik Nayak
strbuf_addf(&out, " -> %s", symref); > } > else if (filter->verbose) > /* " f7c0c00 [ahead 58, behind 197] vcs-svn: drop obj_pool.h" > */ > diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh > index 4261

Re: [PATCH v3 00/16] port branch.c to use ref-filter's printing options

2016-04-01 Thread Karthik Nayak
On Fri, Apr 1, 2016 at 8:45 PM, Ramsay Jones wrote: > > > On 01/04/16 14:44, Dennis Kaarsemaker wrote: >> On Fri, Apr 01, 2016 at 03:31:17PM +0200, Dennis Kaarsemaker wrote: >>> On wo, 2016-03-30 at 15:09 +0530, Karthik Nayak wrote: >>>> >>>> This

Re: [PATCH v3 13/16] ref-filter: allow porcelain to translate messages in the output

2016-04-01 Thread Karthik Nayak
cc'ing Matthieu since this patch was initially written by him. On Thu, Mar 31, 2016 at 3:28 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> +static struct ref_msg { >> + const char *gone; >> + const char *ahead; >> + const char *behind

Re: [PATCH v3 05/16] ref-filter: move get_head_description() from branch.c

2016-04-01 Thread Karthik Nayak
On Thu, Mar 31, 2016 at 3:46 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> -static char *get_head_description(void) >> -{ >> - struct strbuf desc = STRBUF_INIT; >> - struct wt_status_state state; >> - memset(&state, 0, sizeof(state))

Re: [PATCH v3 09/16] ref-filter: make "%(symref)" atom work with the ':short' modifier

2016-04-01 Thread Karthik Nayak
On Thu, Mar 31, 2016 at 3:47 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> The "%(symref)" atom doesn't work when used with the ':short' modifier >> because we strictly match only 'symref' for setting the 'need_symref' &

[PATCH v3 06/16] ref-filter: introduce format_ref_array_item()

2016-03-30 Thread Karthik Nayak
. show_ref_array_item() is kept as a convenience wrapper around it which obtains the strbuf and prints it the standard output. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- ref-filter.c | 16 ref-filter.h | 3 +++ 2 files changed, 15

[PATCH v3 13/16] ref-filter: allow porcelain to translate messages in the output

2016-03-30 Thread Karthik Nayak
ned-off-by: Karthik Nayak --- ref-filter.c | 28 ref-filter.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 73e0a7f..3435df1 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -15,6 +15,26 @@ #include

[PATCH v3 09/16] ref-filter: make "%(symref)" atom work with the ':short' modifier

2016-03-30 Thread Karthik Nayak
%(symref:short) while we're here. Helped-by: Junio C Hamano Signed-off-by: Karthik Nayak --- ref-filter.c| 2 +- t/t6300-for-each-ref.sh | 24 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ref-filter.c b/ref-filter.c index 8c97cdb..5c

[PATCH v3 11/16] ref-filter: introduce refname_atom_parser()

2016-03-30 Thread Karthik Nayak
Introduce refname_atom_parser() which will parse the '%(refname)' atom and store information into the 'used_atom' structure based on the modifiers used along with the atom. Signed-off-by: Karthik Nayak --- ref-filter.c | 70 +---

[PATCH v3 14/16] branch, tag: use porcelain output

2016-03-30 Thread Karthik Nayak
slation. Written-by: Matthieu Moy Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 2 ++ builtin/tag.c| 2 ++ 2 files changed, 4 insertions(+) diff --git a/builtin/branch.c b/builtin/branch.c index 460f32f..8747d82 100644 --- a/bu

[PATCH v3 16/16] branch: implement '--format' option

2016-03-30 Thread Karthik Nayak
Implement the '--format' option provided by 'ref-filter'. This lets the user list branches as per desired format similar to the implementation in 'git for-each-ref'. Add tests and documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy

[PATCH v3 15/16] branch: use ref-filter printing APIs

2016-03-30 Thread Karthik Nayak
reflect these changes. Change calc_maxwidth() to also account for the length of HEAD ref, by calling ref-filter:get_head_discription(). Also change the test in t6040 to reflect the changes. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c

[PATCH v3 00/16] port branch.c to use ref-filter's printing options

2016-03-30 Thread Karthik Nayak
here: $(gmane/288863) Changes in this version: 1. Only Documentation and commit message changes as suggested by Jacob in v2. Thanks to Jacob for his suggestions on the previous iteration. Karthik Nayak (16): ref-filter: implement %(if), %(then), and %(else) atoms ref-filter: include reference t

[PATCH v3 12/16] ref-filter: add support for %(refname:dir) and %(refname:base)

2016-03-30 Thread Karthik Nayak
the same. Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 4 +++- ref-filter.c | 28 +--- t/t6300-for-each-ref.sh| 2 ++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Documentation/git-for-each

[PATCH v3 07/16] ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams

2016-03-30 Thread Karthik Nayak
each-ref.sh and Documentation/git-for-each-ref.txt to reflect this change. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Helped-by : Jacob Keller Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 3 ++- ref-filter.c | 4 +++- t/t6300-

[PATCH v3 05/16] ref-filter: move get_head_description() from branch.c

2016-03-30 Thread Karthik Nayak
HEAD refs description in branch.c:calc_maxwidth() when we port branch.c to use ref-filter APIs. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 31 --- ref-filter.c | 38

[PATCH v3 03/16] ref-filter: implement %(if:equals=) and %(if:notequals=)

2016-03-30 Thread Karthik Nayak
and Documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 3 +++ ref-filter.c | 43 +- t/t6302-for-each-ref-filter.sh | 18 +++

[PATCH v3 08/16] ref-filter: add support for %(upstream:track,nobracket)

2016-03-30 Thread Karthik Nayak
er Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 8 +++-- ref-filter.c | 67 +- t/t6300-for-each-ref.sh| 2 ++ 3 files changed, 51 insertions(+), 26 deletions(-) diff --git a/Do

[PATCH v3 04/16] ref-filter: modify "%(objectname:short)" to take length

2016-03-30 Thread Karthik Nayak
s unique. Add tests and documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Helped-by: Jacob Keller Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 4 ref-filter.c | 25 +++-- t/t

[PATCH v3 10/16] ref-filter: introduce symref_atom_parser()

2016-03-30 Thread Karthik Nayak
Introduce symref_atom_parser() which will parse the '%(symref)' atom and store information into the 'used_atom' structure based on the modifiers used along with the atom. Signed-off-by: Karthik Nayak --- ref-filter.c | 25 +++-- 1 file changed, 23 insert

[PATCH v3 01/16] ref-filter: implement %(if), %(then), and %(else) atoms

2016-03-30 Thread Karthik Nayak
-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 45 +++-- ref-filter.c | 133 +++-- t/t6302-for-each-ref-filter.sh | 70 +++ 3 files changed, 237 insertions(+), 11 deletions(-) diff --git a

[PATCH v3 02/16] ref-filter: include reference to 'used_atom' within 'atom_value'

2016-03-30 Thread Karthik Nayak
therefore removing the necessity of passing %(align) atom's parameters to 'atom_value'. This also acts as a preparatory patch for the upcoming patch where we introduce %(if:equals=) and %(if:notequals=). Signed-off-by: Karthik Nayak --- ref-filter.c | 8 +++- 1 file changed, 3 in

Re: [PATCH v2 00/16] port branch.c to use ref-filter's printing options

2016-03-19 Thread Karthik Nayak
Hello, On Wed, Mar 16, 2016 at 3:30 AM, Jacob Keller wrote: > On Tue, Mar 15, 2016 at 9:47 AM, Karthik Nayak wrote: >> diff --git a/Documentation/git-for-each-ref.txt >> b/Documentation/git-for-each-ref.txt >> index 193e99e..578bbd1 100644 >> --- a/Documentation/gi

Re: [PATCH v2 04/16] ref-filter: modify "%(objectname:short)" to take length

2016-03-19 Thread Karthik Nayak
Hello On Wed, Mar 16, 2016 at 3:41 AM, Jacob Keller wrote: > On Tue, Mar 15, 2016 at 9:47 AM, Karthik Nayak wrote: >> Add support for %(objectname:short=) which would print the >> abbreviated unique objectname of given length. When no length is >> specified 7 is used.

[PATCH v2 13/16] ref-filter: allow porcelain to translate messages in the output

2016-03-15 Thread Karthik Nayak
ned-off-by: Karthik Nayak --- ref-filter.c | 28 ref-filter.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 73e0a7f..3435df1 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -15,6 +15,26 @@ #include

[PATCH v2 09/16] ref-filter: make "%(symref)" atom work with the ':short' modifier

2016-03-15 Thread Karthik Nayak
%(symref:short) while we're here. Helped-by: Junio C Hamano Signed-off-by: Karthik Nayak --- ref-filter.c| 2 +- t/t6300-for-each-ref.sh | 24 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ref-filter.c b/ref-filter.c index 8c97cdb..5c

[PATCH v2 03/16] ref-filter: implement %(if:equals=) and %(if:notequals=)

2016-03-15 Thread Karthik Nayak
and Documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 3 +++ ref-filter.c | 43 +- t/t6302-for-each-ref-filter.sh | 18 +++

[PATCH v2 04/16] ref-filter: modify "%(objectname:short)" to take length

2016-03-15 Thread Karthik Nayak
Signed-off-by: Karthik Nayak --- ref-filter.c| 25 +++-- t/t6300-for-each-ref.sh | 10 ++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 857a8b5..17f781d 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -5

[PATCH v2 16/16] branch: implement '--format' option

2016-03-15 Thread Karthik Nayak
Implement the '--format' option provided by 'ref-filter'. This lets the user list branches as per desired format similar to the implementation in 'git for-each-ref'. Add tests and documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy

[PATCH v2 14/16] branch, tag: use porcelain output

2016-03-15 Thread Karthik Nayak
slation. Written-by: Matthieu Moy Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 2 ++ builtin/tag.c| 2 ++ 2 files changed, 4 insertions(+) diff --git a/builtin/branch.c b/builtin/branch.c index 460f32f..8747d82 100644 --- a/bu

[PATCH v2 10/16] ref-filter: introduce symref_atom_parser()

2016-03-15 Thread Karthik Nayak
Introduce symref_atom_parser() which will parse the '%(symref)' atom and store information into the 'used_atom' structure based on the modifiers used along with the atom. Signed-off-by: Karthik Nayak --- ref-filter.c | 25 +++-- 1 file changed, 23 insert

[PATCH v2 08/16] ref-filter: add support for %(upstream:track,nobracket)

2016-03-15 Thread Karthik Nayak
er Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 5 ++- ref-filter.c | 67 +- t/t6300-for-each-ref.sh| 2 ++ 3 files changed, 50 insertions(+), 24 deletions(-) diff --git a/Docume

[PATCH v2 12/16] ref-filter: add support for %(refname:dir) and %(refname:base)

2016-03-15 Thread Karthik Nayak
the same. Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 4 +++- ref-filter.c | 28 +--- t/t6300-for-each-ref.sh| 2 ++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Documentation/git-for-each

[PATCH v2 11/16] ref-filter: introduce refname_atom_parser()

2016-03-15 Thread Karthik Nayak
Introduce refname_atom_parser() which will parse the '%(refname)' atom and store information into the 'used_atom' structure based on the modifiers used along with the atom. Signed-off-by: Karthik Nayak --- ref-filter.c | 70 +---

[PATCH v2 07/16] ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams

2016-03-15 Thread Karthik Nayak
each-ref.sh and Documentation/git-for-each-ref.txt to reflect this change. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Helped-by : Jacob Keller Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 3 ++- ref-filter.c | 4 +++- t/t6300-

[PATCH v2 05/16] ref-filter: move get_head_description() from branch.c

2016-03-15 Thread Karthik Nayak
HEAD refs description in branch.c:calc_maxwidth() when we port branch.c to use ref-filter APIs. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 31 --- ref-filter.c | 38

[PATCH v2 02/16] ref-filter: include reference to 'used_atom' within 'atom_value'

2016-03-15 Thread Karthik Nayak
therefore removing the necessity of passing %(align) atom's parameters to 'atom_value'. This also acts as a preparatory patch for the upcoming patch where we introduce %(if:equals=) and %(if:notequals=). Signed-off-by: Karthik Nayak --- ref-filter.c | 8 +++- 1 file changed, 3 in

[PATCH v2 15/16] branch: use ref-filter printing APIs

2016-03-15 Thread Karthik Nayak
reflect these changes. Change calc_maxwidth() to also account for the length of HEAD ref, by calling ref-filter:get_head_discription(). Also change the test in t6040 to reflect the changes. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c

[PATCH v2 06/16] ref-filter: introduce format_ref_array_item()

2016-03-15 Thread Karthik Nayak
. show_ref_array_item() is kept as a convenience wrapper around it which obtains the strbuf and prints it the standard output. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- ref-filter.c | 16 ref-filter.h | 3 +++ 2 files changed, 15

[PATCH v2 01/16] ref-filter: implement %(if), %(then), and %(else) atoms

2016-03-15 Thread Karthik Nayak
-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 45 +++-- ref-filter.c | 133 +++-- t/t6302-for-each-ref-filter.sh | 70 +++ 3 files changed, 237 insertions(+), 11 deletions(-) diff --git a

[PATCH v2 00/16] port branch.c to use ref-filter's printing options

2016-03-15 Thread Karthik Nayak
3. add missing documentation for %(upstream:track). 4. Fix commit message. Thanks to Jacob and Junio for their suggestions on the first iteration. Karthik Nayak (16): ref-filter: implement %(if), %(then), and %(else) atoms ref-filter: include reference to 'used_atom' within 'atom_

Re: [PATCH 15/15] branch: implement '--format' option

2016-03-15 Thread Karthik Nayak
On Tue, Mar 8, 2016 at 7:28 AM, Jacob Keller wrote: > On Sun, Mar 6, 2016 at 4:05 AM, Karthik Nayak wrote: >> Implement the '--format' option provided by 'ref-filter'. >> This lets the user list tags as per desired format similar >> to the implementa

Re: [PATCH 08/15] ref-filter: make "%(symref)" atom work with the ':short' modifier

2016-03-09 Thread Karthik Nayak
On Wed, Mar 9, 2016 at 1:49 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> On Tue, Mar 8, 2016 at 7:26 AM, Jacob Keller wrote: >>> On Mon, Mar 7, 2016 at 3:08 PM, Junio C Hamano wrote: >>>> Karthik Nayak writes: >>>> >>>>>

Re: [PATCH 08/15] ref-filter: make "%(symref)" atom work with the ':short' modifier

2016-03-07 Thread Karthik Nayak
On Tue, Mar 8, 2016 at 7:26 AM, Jacob Keller wrote: > On Mon, Mar 7, 2016 at 3:08 PM, Junio C Hamano wrote: >> Karthik Nayak writes: >> >>> The "%(symref)" atom doesn't work when used with the ':short' modifier >>> because we

Re: [PATCH 06/15] ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams

2016-03-07 Thread Karthik Nayak
On Tue, Mar 8, 2016 at 7:25 AM, Jacob Keller wrote: > On Sun, Mar 6, 2016 at 4:04 AM, Karthik Nayak wrote: >> Borrowing from branch.c's implementation print "[gone]" whenever an >> unknown upstream ref is encountered instead of just ignoring it. >> >> Th

Re: [PATCH 02/15] ref-filter: implement %(if:equals=) and %(if:notequals=)

2016-03-07 Thread Karthik Nayak
On Tue, Mar 8, 2016 at 11:34 AM, Junio C Hamano wrote: > On Mon, Mar 7, 2016 at 9:41 PM, Karthik Nayak wrote: >> >> You're correct, the "handler" functions run once for each "ref". But WRT >> to the %(if)...%(then)...%(else)...%(end) atoms, it needs

Re: [PATCH 02/15] ref-filter: implement %(if:equals=) and %(if:notequals=)

2016-03-07 Thread Karthik Nayak
On Tue, Mar 8, 2016 at 4:19 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> diff --git a/ref-filter.c b/ref-filter.c >> index 41e73f0..440e270 100644 >> --- a/ref-filter.c >> +++ b/ref-filter.c >> @@ -22,6 +22,8 @@ struct align { >> }; >&g

[PATCH 08/15] ref-filter: make "%(symref)" atom work with the ':short' modifier

2016-03-06 Thread Karthik Nayak
The "%(symref)" atom doesn't work when used with the ':short' modifier because we strictly match only 'symref' for setting the 'need_symref' indicator. Fix this by using 'starts_with()' rather than 'strcmp()'. Add tests for %(symr

[PATCH 13/15] branch, tag: use porcelain output

2016-03-06 Thread Karthik Nayak
slation. Written-by: Matthieu Moy Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 2 ++ builtin/tag.c| 2 ++ 2 files changed, 4 insertions(+) diff --git a/builtin/branch.c b/builtin/branch.c index 460f32f..8747d82 100644 --- a/bu

[PATCH 15/15] branch: implement '--format' option

2016-03-06 Thread Karthik Nayak
Implement the '--format' option provided by 'ref-filter'. This lets the user list tags as per desired format similar to the implementation in 'git for-each-ref'. Add tests and documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy

[PATCH 14/15] branch: use ref-filter printing APIs

2016-03-06 Thread Karthik Nayak
reflect these changes. Change calc_maxwidth() to also account for the length of HEAD ref, by calling ref-filter:get_head_discription(). Also change the test in t6040 to reflect the changes. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c

[PATCH 07/15] ref-filter: add support for %(upstream:track,nobracket)

2016-03-06 Thread Karthik Nayak
er Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 6 ++-- ref-filter.c | 67 +- t/t6300-for-each-ref.sh| 2 ++ 3 files changed, 50 insertions(+), 25 deletions(-) diff --git a/Do

[PATCH 10/15] ref-filter: introduce refname_atom_parser()

2016-03-06 Thread Karthik Nayak
Introduce refname_atom_parser() which will parse the '%(refname)' atom and store information into the 'used_atom' structure based on the modifiers used along with the atom. Signed-off-by: Karthik Nayak --- ref-filter.c | 70 +---

[PATCH 06/15] ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams

2016-03-06 Thread Karthik Nayak
-each-ref.sh to reflect this change. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- ref-filter.c| 4 +++- t/t6300-for-each-ref.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 2896cde.

[PATCH 11/15] ref-filter: add support for %(refname:dir) and %(refname:base)

2016-03-06 Thread Karthik Nayak
the same. Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 4 +++- ref-filter.c | 28 +--- t/t6300-for-each-ref.sh| 2 ++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Documentation/git-for-each

[PATCH 12/15] ref-filter: allow porcelain to translate messages in the output

2016-03-06 Thread Karthik Nayak
ned-off-by: Karthik Nayak --- ref-filter.c | 28 ref-filter.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 45f9d16..76ea7c3 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -15,6 +15,26 @@ #include

[PATCH 09/15] ref-filter: introduce symref_atom_parser()

2016-03-06 Thread Karthik Nayak
Introduce symref_atom_parser() which will parse the '%(symref)' atom and store information into the 'used_atom' structure based on the modifiers used along with the atom. Signed-off-by: Karthik Nayak --- ref-filter.c | 26 -- 1 file changed, 24 insert

[PATCH 05/15] ref-filter: introduce format_ref_array_item()

2016-03-06 Thread Karthik Nayak
. show_ref_array_item() is kept as a convenience wrapper around it which obtains the strbuf and prints it the standard output. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- ref-filter.c | 16 ref-filter.h | 3 +++ 2 files changed, 15

[PATCH 01/15] ref-filter: implement %(if), %(then), and %(else) atoms

2016-03-06 Thread Karthik Nayak
-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 45 +++-- ref-filter.c | 133 +++-- t/t6302-for-each-ref-filter.sh | 70 +++ 3 files changed, 237 insertions(+), 11 deletions(-) diff --git a

[PATCH 04/15] ref-filter: move get_head_description() from branch.c

2016-03-06 Thread Karthik Nayak
HEAD refs description in branch.c:calc_maxwidth() when we port branch.c to use ref-filter APIs. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 31 --- ref-filter.c | 38

[PATCH 02/15] ref-filter: implement %(if:equals=) and %(if:notequals=)

2016-03-06 Thread Karthik Nayak
then) atom is differnt from the given ''. Add tests and Documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 3 +++ ref-filter.c | 29 ++

[PATCH 03/15] ref-filter: modify "%(objectname:short)" to take length

2016-03-06 Thread Karthik Nayak
Signed-off-by: Karthik Nayak --- ref-filter.c| 25 +++-- t/t6300-for-each-ref.sh | 10 ++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 440e270..2ab90d4 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -5

[PATCH 00/15] port branch.c to use ref-filter's printing options

2016-03-06 Thread Karthik Nayak
rsing mechanism, which is now merged into master (9606218b32344c5c756f7c29349d3845ef60b80c). Karthik Nayak (15): ref-filter: implement %(if), %(then), and %(else) atoms ref-filter: implement %(if:equals=) and %(if:notequals=) ref-filter: modify "%(objectname:short)" to take

Re: GSoC 2016: Microproject

2016-02-22 Thread Karthik Nayak
arning: destructive operations): use git clean > to remove untracked files. > I think a 'sudo git clean' outta be enough. But the main point to take away is not using 'make' with 'sudo' like you mentioned. -- Regards, Karthik Nayak -- To unsubscribe from thi

Re: [PATCH v6 01/11] ref-filter: use string_list_split over strbuf_split

2016-02-18 Thread Karthik Nayak
On Thu, Feb 18, 2016 at 3:49 AM, Junio C Hamano wrote: > Jeff King writes: > >> On Wed, Feb 17, 2016 at 05:11:50PM -0500, Eric Sunshine wrote: >> >>> On Wed, Feb 17, 2016 at 1:06 PM, Karthik Nayak >>> wrote: >>> > From: Jeff King >>>

Re: [PATCH v5 02/12] ref-filter: use strbuf_split_str_omit_term()

2016-02-17 Thread Karthik Nayak
On Wed, Feb 17, 2016 at 11:47 PM, Eric Sunshine wrote: > On Wed, Feb 17, 2016 at 1:07 PM, Karthik Nayak wrote: >> On Wed, Feb 17, 2016 at 11:09 PM, Eric Sunshine >> wrote: >>> I reviewed the entire series again, including Peff's changes, so this >>> ent

Re: [PATCH v5 02/12] ref-filter: use strbuf_split_str_omit_term()

2016-02-17 Thread Karthik Nayak
On Wed, Feb 17, 2016 at 11:09 PM, Eric Sunshine wrote: > On Wed, Feb 17, 2016 at 12:04 PM, Karthik Nayak wrote: >> On Wed, Feb 17, 2016 at 2:39 AM, Eric Sunshine >> wrote: >>> My initial reaction was negative due to the heavy review burden this >>> series h

[PATCH v6 05/11] ref-filter: introduce color_atom_parser()

2016-02-17 Thread Karthik Nayak
Introduce color_atom_parser() which will parse a "color" atom and store its color in the "used_atom" structure for further usage in populate_value(). Helped-by: Ramsay Jones Helped-by: Eric Sunshine Signed-off-by: Karthik Nayak --- ref-filter.c | 25 -

[PATCH v6 10/11] ref-filter: introduce contents_atom_parser()

2016-02-17 Thread Karthik Nayak
and '%(subject)' respectively. Helped-by: Ramsay Jones Helped-by: Eric Sunshine Signed-off-by: Karthik Nayak --- ref-filter.c | 79 ++-- 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/ref-filter.c b/ref-filter.c

[PATCH v6 06/11] ref-filter: introduce parse_align_position()

2016-02-17 Thread Karthik Nayak
>From populate_value() extract parse_align_position() which given a string would give us the alignment position. This is a preparatory patch as to introduce prefixes for the %(align) atom and avoid redundancy in the code. Helped-by: Eric Sunshine Signed-off-by: Karthik Nayak --- ref-filte

[PATCH v6 11/11] ref-filter: introduce objectname_atom_parser()

2016-02-17 Thread Karthik Nayak
Introduce objectname_atom_parser() which will parse the '%(objectname)' atom and store information into the 'used_atom' structure based on the modifiers used along with the atom. Helped-by: Ramsay Jones Helped-by: Eric Sunshine Signed-off-by: Karthik Nayak --

[PATCH v6 08/11] ref-filter: align: introduce long-form syntax

2016-02-17 Thread Karthik Nayak
Introduce optional prefixes "width=" and "position=" for the align atom so that the atom can be used as "%(align:width=,position=)". Add Documentation and tests for the same. Helped-by: Eric Sunshine Signed-off-by: Karthik Nayak --- Documenta

[PATCH v6 03/11] ref-filter: introduce struct used_atom

2016-02-17 Thread Karthik Nayak
Introduce the 'used_atom' structure to replace the existing implementation of 'used_atom' (which is a list of atoms). This helps us parse atoms beforehand and store required details into the 'used_atom' for future usage. Helped-by: Eric Sunshine Signed-off-by: Ka

[PATCH v6 09/11] ref-filter: introduce remote_ref_atom_parser()

2016-02-17 Thread Karthik Nayak
Introduce remote_ref_atom_parser() which will parse the '%(upstream)' and '%(push)' atoms and store information into the 'used_atom' structure based on the modifiers used along with the corresponding atom. Helped-by: Ramsay Jones Helped-by: Eric Sunshine Signed-o

[PATCH v6 07/11] ref-filter: introduce align_atom_parser()

2016-02-17 Thread Karthik Nayak
filter.c. Helped-by: Eric Sunshine Helped-by: Jeff King Helped-by: Ramsay Jones Signed-off-by: Karthik Nayak --- ref-filter.c | 91 ++-- 1 file changed, 40 insertions(+), 51 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index e8b

[PATCH v6 01/11] ref-filter: use string_list_split over strbuf_split

2016-02-17 Thread Karthik Nayak
From: Jeff King We don't do any post-processing on the resulting strbufs, so it is simpler to just use string_list_split, which takes care of removing the delimiter for us. Written-by: Jeff King Signed-off-by: Karthik Nayak --- ref-filter.c | 29 +++-- 1 file ch

[PATCH v6 04/11] ref-filter: introduce parsing functions for each valid atom

2016-02-17 Thread Karthik Nayak
Helped-by: Andreas Schwab Signed-off-by: Karthik Nayak --- ref-filter.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 8139709..8a34ba1 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -36,6 +36,7 @@ static int need_color_re

[PATCH v6 02/11] ref-filter: bump 'used_atom' and related code to the top

2016-02-17 Thread Karthik Nayak
Bump code to the top for usage in further patches. Signed-off-by: Karthik Nayak --- ref-filter.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 19367ce..6a73c5b 100644 --- a/ref-filter.c +++ b/ref-filter.c

[PATCH v6 00/11] ref-filter: use parsing functions

2016-02-17 Thread Karthik Nayak
86425) we drop creation and usage of strbuf_split_str_omit_term() and use string_list_split() instead. Jeff King (1): ref-filter: use string_list_split over strbuf_split Karthik Nayak (10): ref-filter: bump 'used_atom' and related code to the top ref-filter: introduce struct used_at

Re: [PATCH v5 02/12] ref-filter: use strbuf_split_str_omit_term()

2016-02-17 Thread Karthik Nayak
us > turnaround time should be short. > > So, I think I'm fine with it, if Karthik is game. Sounds good to me. I just read the conversation between Jeff, Junio and You about the whitespace counter-argument and I think its good to go ahead with v6 with Jeff's suggested change

Re: [PATCH v5 02/12] ref-filter: use strbuf_split_str_omit_term()

2016-02-17 Thread Karthik Nayak
On Wed, Feb 17, 2016 at 12:52 AM, Jeff King wrote: > On Wed, Feb 17, 2016 at 12:30:05AM +0530, Karthik Nayak wrote: > >> Use the newly introduced strbuf_split_str_omit_term() rather than >> using strbuf_split_str() and manually removing the ',' terminator. &g

[PATCH v5 11/12] ref-filter: introduce contents_atom_parser()

2016-02-16 Thread Karthik Nayak
and '%(subject)' respectively. Helped-by: Ramsay Jones Helped-by: Eric Sunshine Signed-off-by: Karthik Nayak --- ref-filter.c | 79 ++-- 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/ref-filter.c b/ref-filter.c

[PATCH v5 12/12] ref-filter: introduce objectname_atom_parser()

2016-02-16 Thread Karthik Nayak
Introduce objectname_atom_parser() which will parse the '%(objectname)' atom and store information into the 'used_atom' structure based on the modifiers used along with the atom. Helped-by: Ramsay Jones Helped-by: Eric Sunshine Signed-off-by: Karthik Nayak --

[PATCH v5 10/12] ref-filter: introduce remote_ref_atom_parser()

2016-02-16 Thread Karthik Nayak
Introduce remote_ref_atom_parser() which will parse the '%(upstream)' and '%(push)' atoms and store information into the 'used_atom' structure based on the modifiers used along with the corresponding atom. Helped-by: Ramsay Jones Helped-by: Eric Sunshine Signed-o

[PATCH v5 02/12] ref-filter: use strbuf_split_str_omit_term()

2016-02-16 Thread Karthik Nayak
Use the newly introduced strbuf_split_str_omit_term() rather than using strbuf_split_str() and manually removing the ',' terminator. Helped-by: Eric Sunshine Signed-off-by: Karthik Nayak --- ref-filter.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ref-

[PATCH v5 05/12] ref-filter: introduce parsing functions for each valid atom

2016-02-16 Thread Karthik Nayak
Helped-by: Andreas Schwab Signed-off-by: Karthik Nayak --- ref-filter.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 3736dc3..974c412 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -36,6 +36,7 @@ static int need_color_re

[PATCH v5 07/12] ref-filter: introduce parse_align_position()

2016-02-16 Thread Karthik Nayak
>From populate_value() extract parse_align_position() which given a string would give us the alignment position. This is a preparatory patch as to introduce prefixes for the %(align) atom and avoid redundancy in the code. Helped-by: Eric Sunshine Signed-off-by: Karthik Nayak --- ref-filte

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