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

2016-11-11 Thread Karthik Nayak
On Fri, Nov 11, 2016 at 4:50 AM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >>> Minor nit. I'm not sure what standard we use here at Git, but >>> traditionally, I prefer to see { } blocks on all section

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

2016-11-11 Thread Karthik Nayak
nore that when a > truly trivial single liner follows if() even if its else clause is a > big block, e.g. > > if (cond) > single; > else { > big; > block; > } > > I agree with you that this case should just use {} for the following > paragraph, because it is technically a single-liner, but comes with > a big comment block and is very much easier to read with {} around > it. > Ah! I see, sure I'll change it :) -- Regards, Karthik Nayak

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

2016-11-10 Thread Karthik Nayak
On Wed, Nov 9, 2016 at 5:01 AM, Jacob Keller <jacob.kel...@gmail.com> wrote: > On Tue, Nov 8, 2016 at 12:11 PM, Karthik Nayak <karthik@gmail.com> wrote: > >> >> - if (starts_with(name, "refname")) >>

Re: [PATCH v7 03/17] ref-filter: implement %(if:equals=) and %(if:notequals=)

2016-11-10 Thread Karthik Nayak
On Wed, Nov 9, 2016 at 4:52 AM, Jacob Keller <jacob.kel...@gmail.com> wrote: > On Tue, Nov 8, 2016 at 12:11 PM, Karthik Nayak <karthik@gmail.com> wrote: > > Ok. How does this handle whitespace? The previous if implementation > treated whitespace as trimming to i

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

2016-11-10 Thread Karthik Nayak
On Wed, Nov 9, 2016 at 4:57 AM, Jacob Keller <jacob.kel...@gmail.com> wrote: > On Tue, Nov 8, 2016 at 12:11 PM, Karthik Nayak <karthik@gmail.com> wrote: >> From: Karthik Nayak <karthik@gmail.com> >> >> Add support for %(objectname:short=) whic

Re: [PATCH v7 02/17] ref-filter: include reference to 'used_atom' within 'atom_value'

2016-11-10 Thread Karthik Nayak
ion and we were copying it. > > Ok, so this looks good. > It is confusing if one only looks at the patch without actually going through ref-filter.c. I'm sure your comment will help anyone going through these patches. -- Regards, Karthik Nayak

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

2016-11-10 Thread Karthik Nayak
Hey, On Wed, Nov 9, 2016 at 4:43 AM, Jacob Keller <jacob.kel...@gmail.com> wrote: > On Tue, Nov 8, 2016 at 12:11 PM, Karthik Nayak <karthik@gmail.com> wrote: >> From: Karthik Nayak <karthik@gmail.com> >> >> +Some atoms like %(align) and %(if) always

[PATCH v7 11/17] ref-filter: introduce symref_atom_parser() and refname_atom_parser()

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Using refname_atom_parser_internal(), introduce symref_atom_parser() and refname_atom_parser() which will parse the atoms %(symref) and %(refname) respectively. Store the parsed information into the 'used_atom' structure based on the modifier

[PATCH v7 13/17] ref-filter: add `:dir` and `:base` options for ref printing atoms

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Add the options `:dir` and `:base` to all ref printing ('%(refname)', '%(symref)', '%(push)' and '%(upstream)') atoms. The `:dir` option gives the directory (the part after $GIT_DIR/) of the ref without the refname. The `:base` option gives th

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

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Borrowing from branch.c's implementation print "[gone]" whenever an unknown upstream ref is encountered instead of just ignoring it. This makes sure that when branch.c is ported over to using ref-filter APIs for printing, this fea

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

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Call ref-filter's setup_ref_filter_porcelain_msg() to enable translated messages for the %(upstream:tack) atom. Although branch.c doesn't currently use ref-filter's printing API's, this will ensure that when it does in the future patches, we do no

[PATCH v7 06/17] ref-filter: introduce format_ref_array_item()

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> To allow column display, we will need to first render the output in a string list to allow print_columns() to compute the proper size of each column before starting the actual output. Introduce the function format_ref_array_item() tha

[PATCH v7 17/17] branch: implement '--format' option

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

[PATCH v7 14/17] ref-filter: allow porcelain to translate messages in the output

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Introduce setup_ref_filter_porcelain_msg() so that the messages used in the atom %(upstream:track) can be translated if needed. This is needed as we port branch.c to use ref-filter's printing API's. Written-by: Matthieu Moy <matthieu

[PATCH v7 10/17] ref-filter: introduce refname_atom_parser_internal()

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Since there are multiple atoms which print refs ('%(refname)', '%(symref)', '%(push)', '%upstream'), it makes sense to have a common ground for parsing them. This would allow us to share implementations of the atom modifiers between these

[PATCH v7 16/17] branch: use ref-filter printing APIs

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Port branch.c to use ref-filter APIs for printing. This clears out most of the code used in branch.c for printing and replaces them with calls made to the ref-filter library. Introduce build_format() which gets the format required for printing o

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

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Add support for %(upstream:track,nobracket) which will print the tracking information without the brackets (i.e. "ahead N, behind M"). This is needed when we port branch.c to use ref-filter's printing APIs. Add test and documentat

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

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> 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 comparing with valid_atom rather than used_atom. Add te

[PATCH v7 12/17] ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Use the recently introduced refname_atom_parser_internal() within remote_ref_atom_parser(), this provides a common base for all the ref printing atoms, allowing %(upstream) and %(push) to also use the ':strip' option. The atoms '

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

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Move the implementation of get_head_description() from branch.c to ref-filter. This gives a description of the HEAD ref if called. This is used as the refname for the HEAD ref whenever the FILTER_REFS_DETACHED_HEAD option is used. Make it

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

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Add support for %(objectname:short=) which would print the abbreviated unique objectname of given length. When no length is specified, the length is 'DEFAULT_ABBREV'. The minimum length is 'MINIMUM_ABBREV'. The length may be exceeded to

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

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Ensure that each 'atom_value' has a reference to its corresponding 'used_atom'. This let's us use values within 'used_atom' in the 'handler' function. Hence we can get the %(align) atom's parameters directly from the 'used_atom' therefore re

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

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Implement %(if:equals=) wherein the if condition is only satisfied if the value obtained between the %(if:...) and %(then) atom is the same as the given ''. Similarly, implement (if:notequals=) wherein the if condition is only satisfied if the

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

2016-11-08 Thread Karthik Nayak
From: Karthik Nayak <karthik@gmail.com> Implement %(if), %(then) and %(else) atoms. Used as %(if)...%(then)...%(end) or %(if)...%(then)...%(else)...%(end). If the format string between %(if) and %(then) expands to an empty string, or to only whitespaces, then the whole %(if)...%(end) e

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

2016-11-08 Thread Karthik Nayak
://marc.info/?l=git=146330914118766=2 Changes in this version: 1. Rebased on top of master. Karthik Nayak (17): ref-filter: implement %(if), %(then), and %(else) atoms ref-filter: include reference to 'used_atom' within 'atom_value' ref-filter: implement %(if:equals=) and %(if:notequals=) ref

Re: What's cooking in git.git (Oct 2016, #09; Mon, 31)

2016-11-08 Thread Karthik Nayak
Helo, On Tue, Nov 8, 2016 at 1:58 PM, Jacob Keller <jacob.kel...@gmail.com> wrote: > On Nov 8, 2016 12:24 AM, "Karthik Nayak" <karthik@gmail.com> wrote: >> Anything I could do to push this forward? It's been a while now. > > Hi, > > If this just nee

Re: What's cooking in git.git (Oct 2016, #09; Mon, 31)

2016-11-08 Thread Karthik Nayak
Hello, > > * kn/ref-filter-branch-list (2016-05-17) 17 commits > - branch: implement '--format' option > - branch: use ref-filter printing APIs > - branch, tag: use porcelain output > - ref-filter: allow porcelain to translate messages in the output > - ref-filter: add `:dir` and `:base`

Re: [PATCH v2] for-each-ref: add %(upstream:gone) to mark missing refs

2016-08-26 Thread Karthik Nayak
ually does even > though they're months old at this point? > Not that your review would be absolute but it definitely would be a start. Replying directly to the patches is the way to go I feel. -- 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 v2] for-each-ref: add %(upstream:gone) to mark missing refs

2016-08-24 Thread Karthik Nayak
hat topic is waiting on more review. > If you're willing and able to do so, that would be a big help. > It's been waiting for review for a _long_ time now. -- 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 05/17] ref-filter: move get_head_description() from branch.c

2016-05-20 Thread Karthik Nayak
>> + } > > ... but the change is apparently lost. > > It is a good lesson not to blindly rebase things on 'next', which > would have unrelated changes. If you needed es/test-gpg-tags topic > for the test script change, check out 'master', merge that single > topic,

Re: [PATCH v6 00/17] Port branch.c to use ref-filter's printing options

2016-05-18 Thread Karthik Nayak
On Wed, May 18, 2016 at 2:00 AM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> Sorry for that. >> The only reason I haven't based it on 'master' is because it doesn't contain >> 'f307218'. >> >> ➔

Re: [PATCH v6 00/17] Port branch.c to use ref-filter's printing options

2016-05-17 Thread Karthik Nayak
On Tue, May 17, 2016 at 11:22 PM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> Hello, sorry for the confusion, it's built on top of 'next' which contains >> f307218 (t6302: simplify non-gpg cases). The merge conflic

Re: [PATCH v6 00/17] Port branch.c to use ref-filter's printing options

2016-05-17 Thread Karthik Nayak
On Tue, May 17, 2016 at 3:42 AM, Junio C Hamano <gits...@pobox.com> wrote: > > Karthik Nayak <karthik@gmail.com> writes: > > > This is part of unification of the commands 'git tag -l, git branch -l > > and git for-each-ref'. This ports over branch.c to use

[PATCH v6 17/17] branch: implement '--format' option

2016-05-15 Thread Karthik Nayak
eu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-branch.txt | 7 ++- builtin/branch.c | 14 +- t/t3203-branch-output.sh | 14 ++ 3 files changed, 29 insertions(+), 6 deleti

[PATCH v6 16/17] branch: use ref-filter printing APIs

2016-05-15 Thread Karthik Nayak
symrefs by default. We also allow the user to change the format if needed with the introduction of the '--format' option in the next patch. Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Na

[PATCH v6 13/17] ref-filter: add `:dir` and `:base` options for ref printing atoms

2016-05-15 Thread Karthik Nayak
following $GIT_DIR/refs/). Add tests and documentation for the same. Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 34 +++--- ref-filter.c | 29 + t/t6300-for-each-

[PATCH v6 10/17] ref-filter: introduce refname_atom_parser_internal()

2016-05-15 Thread Karthik Nayak
as a common parsing function for ref printing atoms. This would eventually be used to introduce refname_atom_parser() and symref_atom_parser() and also be internally used in remote_ref_atom_parser(). Helped-by: Jeff King <p...@peff.net> Signed-off-by: Karthik Nayak <karthik@gmail.com&

[PATCH v6 14/17] ref-filter: allow porcelain to translate messages in the output

2016-05-15 Thread Karthik Nayak
Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- ref-filter.c | 28 ref-filter.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ref-filte

[PATCH v6 12/17] ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()

2016-05-15 Thread Karthik Nayak
' atom modifiers to themselves as they have no meaning in context to the '%(refname)' and '%(symref)' atoms. Update the documentation and tests to reflect the same. Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 27 ++

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

2016-05-15 Thread Karthik Nayak
e. Helped-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- 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 b

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

2016-05-15 Thread Karthik Nayak
-by: Matthieu Moy <matthieu@grenoble-inp.fr> 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 | 2 ++ builtin/tag.c| 2 ++ 2 fil

[PATCH v6 11/17] ref-filter: introduce symref_atom_parser() and refname_atom_parser()

2016-05-15 Thread Karthik Nayak
supports the ':strip' atom modifier. Update the Documentation and tests to reflect this. Helped-by: Jeff King <p...@peff.net> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 5 +++ ref-filter.c

[PATCH v6 06/17] ref-filter: introduce format_ref_array_item()

2016-05-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 <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmai

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

2016-05-15 Thread Karthik Nayak
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 | 67 +- t/t6300-for-each-

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

2016-05-15 Thread Karthik Nayak
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 <karthik@gmail.com> --- ref-filter.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ref-filt

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

2016-05-15 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 | 45 +++-- ref-filter.c | 133 +++-- t/t6302-for-each-ref-f

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

2016-05-15 Thread Karthik Nayak
ach-ref.sh and Documentation/git-for-each-ref.txt to reflect this change. Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Helped-by : Jacob Keller <jacob.kel...@gmail.com> Signed-off-by: Karthik Nayak <karthik@gm

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

2016-05-15 Thread Karthik Nayak
and documentation for the same. Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Helped-by: Jacob Keller <jacob.kel...@gmail.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/g

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

2016-05-15 Thread Karthik Nayak
. 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 +++ ref-filter.c

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

2016-05-15 Thread Karthik Nayak
of the HEAD refs description in branch.c:calc_maxwidth() when we port branch.c 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> --- bui

[PATCH v6 00/17] Port branch.c to use ref-filter's printing options

2016-05-15 Thread Karthik Nayak
. Rebased on top of f307218 (t6302: simplify non-gpg cases). This patch ensures that we only use signed tags when GPG is installed and effectively gets rid of the bug introduced by 01/17 (ref-filter: implement %(if), %(then), and %(else) atoms)[1]. [1]: $(gmane/293901) Karthik Nayak (17): ref-filter

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

2016-04-26 Thread Karthik Nayak
On Tue, Apr 26, 2016 at 3:17 AM, Junio C Hamano <gits...@pobox.com> wrote: > Karthik Nayak <karthik@gmail.com> writes: > >> This is part of unification of the commands 'git tag -l, git branch -l >> and git for-each-ref'. This ports over branch.c to use re

[PATCH v5b 11/17] ref-filter: introduce symref_atom_parser() and refname_atom_parser()

2016-04-25 Thread Karthik Nayak
supports the ':strip' atom modifier. Update the Documentation and tests to reflect this. Helped-by: Jeff King <p...@peff.net> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 5 +++ ref-filter.c

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

2016-04-25 Thread Karthik Nayak
e. Helped-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- 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 b

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

2016-04-25 Thread Karthik Nayak
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 <karthik@gmail.com> --- ref-filter.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ref-filt

[PATCH v5b 13/17] ref-filter: add `:dir` and `:base` options for ref printing atoms

2016-04-25 Thread Karthik Nayak
following $GIT_DIR/refs/). Add tests and documentation for the same. Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 34 +++--- ref-filter.c | 29 + t/t6300-for-each-

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

2016-04-25 Thread Karthik Nayak
of the HEAD refs description in branch.c:calc_maxwidth() when we port branch.c 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> --- bui

[PATCH v5b 12/17] ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()

2016-04-25 Thread Karthik Nayak
' atom modifiers to themselves as they have no meaning in context to the '%(refname)' and '%(symref)' atoms. Update the documentation and tests to reflect the same. Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 27 ++

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

2016-04-25 Thread Karthik Nayak
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 | 67 +- t/t6300-for-each-

[PATCH v5b 16/17] branch: use ref-filter printing APIs

2016-04-25 Thread Karthik Nayak
symrefs by default. We also allow the user to change the format if needed with the introduction of the '--format' option in the next patch. Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Na

[PATCH v5b 10/17] ref-filter: introduce refname_atom_parser_internal()

2016-04-25 Thread Karthik Nayak
as a common parsing function for ref printing atoms. This would eventually be used to introduce refname_atom_parser() and symref_atom_parser() and also be internally used in remote_ref_atom_parser(). Helped-by: Jeff King <p...@peff.net> Signed-off-by: Karthik Nayak <karthik@gmail.com&

[PATCH v5b 17/17] branch: implement '--format' option

2016-04-25 Thread Karthik Nayak
eu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-branch.txt | 7 ++- builtin/branch.c | 14 +- t/t3203-branch-output.sh | 14 ++ 3 files changed, 29 insertions(+), 6 deleti

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

2016-04-25 Thread Karthik Nayak
-by: Matthieu Moy <matthieu@grenoble-inp.fr> 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 | 2 ++ builtin/tag.c| 2 ++ 2 fil

[PATCH v5b 14/17] ref-filter: allow porcelain to translate messages in the output

2016-04-25 Thread Karthik Nayak
Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- ref-filter.c | 28 ref-filter.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ref-filte

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

2016-04-25 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 | 45 +++-- ref-filter.c | 133 +++-- t/t6302-for-each-ref-f

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

2016-04-25 Thread Karthik Nayak
. 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 +++ ref-filter.c

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

2016-04-25 Thread Karthik Nayak
ach-ref.sh and Documentation/git-for-each-ref.txt to reflect this change. Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Helped-by : Jacob Keller <jacob.kel...@gmail.com> Signed-off-by: Karthik Nayak <karthik@gm

[PATCH v5b 06/17] ref-filter: introduce format_ref_array_item()

2016-04-25 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 <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmai

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

2016-04-25 Thread Karthik Nayak
and documentation for the same. Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Helped-by: Jacob Keller <jacob.kel...@gmail.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/g

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

2016-04-25 Thread Karthik Nayak
-printing atoms. Written by Jeff. 4. Fix a memory leak which was reported by Stefan ($gmane/291703). Thanks to Junio, Jeff and Stefan for suggestions on the previous version. Karthik Nayak (17): ref-filter: implement %(if), %(then), and %(else) atoms ref-filter: include reference to 'used_atom

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

2016-04-22 Thread Karthik Nayak
-by: Matthieu Moy <matthieu@grenoble-inp.fr> 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 | 2 ++ builtin/tag.c| 2 ++ 2 fil

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

2016-04-22 Thread Karthik Nayak
eu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-branch.txt | 7 ++- builtin/branch.c | 14 +- t/t3203-branch-output.sh | 14 ++ 3 files changed, 29 insertions(+), 6 deleti

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

2016-04-22 Thread Karthik Nayak
of the HEAD refs description in branch.c:calc_maxwidth() when we port branch.c 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> --- bui

[PATCH v5 11/16] ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()

2016-04-22 Thread Karthik Nayak
' atom modifiers to themselves as they have no meaning in context to the '%(refname)' and '%(symref)' atoms. Update the documentation and tests to reflect the same. Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 27 ++

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

2016-04-22 Thread Karthik Nayak
. 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 +++ ref-filter.c

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

2016-04-22 Thread Karthik Nayak
Beller <sbel...@google.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- builtin/branch.c | 234 ++- t/t3203-branch-output.sh | 2 +- t/t6040-tracking-info.sh | 2 +- 3 files changed, 70 insertions(+), 168 deletions(-) diff --

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

2016-04-22 Thread Karthik Nayak
ach-ref.sh and Documentation/git-for-each-ref.txt to reflect this change. Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Helped-by : Jacob Keller <jacob.kel...@gmail.com> Signed-off-by: Karthik Nayak <karthik@gm

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

2016-04-22 Thread Karthik Nayak
and documentation for the same. Mentored-by: Christian Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Helped-by: Jacob Keller <jacob.kel...@gmail.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/g

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

2016-04-22 Thread Karthik Nayak
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 | 67 +- t/t6300-for-each-

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

2016-04-22 Thread Karthik Nayak
Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- ref-filter.c | 28 ref-filter.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ref-filte

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

2016-04-22 Thread Karthik Nayak
e. Helped-by: Junio C Hamano <gits...@pobox.com> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- 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 b

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

2016-04-22 Thread Karthik Nayak
($gmane/291703). Thanks to Junio, Jeff and Stefan for suggestions on the previous version. Karthik Nayak (16): ref-filter: include reference to 'used_atom' within 'atom_value' ref-filter: implement %(if:equals=) and %(if:notequals=) ref-filter: modify "%(objectname:short)" to t

[PATCH v5 09/16] ref-filter: introduce refname_atom_parser_internal()

2016-04-22 Thread Karthik Nayak
as a common parsing function for ref printing atoms. This would eventually be used to introduce refname_atom_parser() and symref_atom_parser() and also be internally used in remote_ref_atom_parser(). Helped-by: Jeff King <p...@peff.net> Signed-off-by: Karthik Nayak <karthik@gmail.com&

[PATCH v5 10/16] ref-filter: introduce symref_atom_parser() and refname_atom_parser()

2016-04-22 Thread Karthik Nayak
supports the ':strip' atom modifier. Update the Documentation and tests to reflect this. Helped-by: Jeff King <p...@peff.net> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 5 +++ ref-filter.c

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

2016-04-22 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 <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmai

[PATCH v5 12/16] ref-filter: add `:dir` and `:base` options for ref printing atoms

2016-04-22 Thread Karthik Nayak
following $GIT_DIR/refs/). Add tests and documentation for the same. Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-for-each-ref.txt | 34 +++--- ref-filter.c | 29 + t/t6300-for-each-

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

2016-04-22 Thread Karthik Nayak
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 <karthik@gmail.com> --- ref-filter.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ref-filt

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

2016-04-17 Thread Karthik Nayak
would you like to take care of this memleak?) Seems like an easy fix. Will take care of it, 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 v4 15/16] branch: use ref-filter printing APIs

2016-04-15 Thread Karthik Nayak
ame.option == R_BASE) { > + return show_ref(>u.refname, ref->refname); > +} > + > +static const char *show_ref(struct refname_atom *atom, const char *refname) > +{ > + if (atom->option == R_SHORT) > + return shorten_unambiguous_ref(refname, warn_ambiguous_refs); > + else if (atom->option == R_STRIP) > + return strip_ref_components(refname, atom->strip); > + else if (atom->option == R_BASE) { > const char *sp, *ep; > > - if (skip_prefix(ref->refname, "refs/", )) { > + if (skip_prefix(refname, "refs/", )) { > ep = strchr(sp, '/'); > if (!ep) > return ""; > return xstrndup(sp, ep - sp); > } > return ""; > - } else if (atom->u.refname.option == R_DIR) { > + } else if (atom->option == R_DIR) { > const char *sp, *ep; > > - sp = ref->refname; > + sp = refname; > ep = strrchr(sp, '/'); > if (!ep) > return ""; > return xstrndup(sp, ep - sp); > } else > - return ref->refname; > + return refname; > } > > /* -- 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 v4 11/16] ref-filter: introduce refname_atom_parser()

2016-04-15 Thread Karthik Nayak
On Fri, Apr 15, 2016 at 2:13 AM, Jeff King <p...@peff.net> wrote: > On Sun, Apr 10, 2016 at 12:15:10AM +0530, Karthik Nayak wrote: > >> +static void refname_atom_parser(struct used_atom *atom, const char *arg) >> +{ >> + if (!arg) >> +

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

2016-04-14 Thread Karthik Nayak
lain command a change like this shouldn't be a problem. Junio, I'll re-roll with a small fix to the test written by Jeff soon. -- 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 v4 15/16] branch: use ref-filter printing APIs

2016-04-13 Thread Karthik Nayak
ere, WRT to the patch v4 it seems the problem is that patch v4 doesn't support v2.6.x behavior, namely that cross-prefix symrefs will not be shortened at all. As per the format given in the last patch [16/16] it shortens the symref irrespective of being cross-prefix symrefs. Would it be a good ide

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

2016-04-13 Thread Karthik Nayak
Hello, On Wed, Apr 13, 2016 at 2:35 AM, Junio C Hamano <gits...@pobox.com> wrote: > Junio C Hamano <gits...@pobox.com> writes: > >> Karthik Nayak <karthik@gmail.com> writes: >> >>> +br

Re: A small Git bug

2016-04-10 Thread Karthik Nayak
, the timestamp of the files involved are updated to reflect the merge. Your text editor seems to have picked up this change in the file's timestamp as changes made to the content of the file. -- 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 v4 06/16] ref-filter: introduce format_ref_array_item()

2016-04-09 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 <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmai

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

2016-04-09 Thread Karthik Nayak
-by: Matthieu Moy <matthieu@grenoble-inp.fr> 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 | 2 ++ builtin/tag.c| 2 ++ 2 fil

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

2016-04-09 Thread Karthik Nayak
eu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- Documentation/git-branch.txt | 7 ++- builtin/branch.c | 14 +- t/t3203-branch-output.sh | 12 3 files changed, 27 insertions(+), 6 deleti

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

2016-04-09 Thread Karthik Nayak
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 | 67 +- t/t6300-for-each-

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

2016-04-09 Thread Karthik Nayak
Couder <christian.cou...@gmail.com> Mentored-by: Matthieu Moy <matthieu@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- ref-filter.c | 28 ref-filter.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ref-filte

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

2016-04-09 Thread Karthik Nayak
@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik@gmail.com> --- builtin/branch.c | 227 ++- t/t6040-tracking-info.sh | 2 +- 2 files changed, 67 insertions(+), 162 deletions(-) diff --git a/builtin/branch.c b/builtin/bran

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