Re: [PATCH/RFC 07/10] ref-filter: introduce align_atom_parser()

2015-12-07 Thread Karthik Nayak
On Thu, Dec 3, 2015 at 2:53 AM, Eric Sunshine wrote: > On Wed, Nov 11, 2015 at 2:44 PM, Karthik Nayak wrote: >> Introduce align_atom_parser() which will parse 'align' atoms and store >> the required width and position into the 'used_atom' structure. While >&

Re: [PATCH/RFC 06/10] strbuf: introduce strbuf_split_str_without_term()

2015-12-03 Thread Karthik Nayak
On Wed, Dec 2, 2015 at 1:34 PM, Eric Sunshine wrote: > On Wed, Nov 11, 2015 at 2:44 PM, Karthik Nayak wrote: >> The current implementation of 'strbuf_split_buf()' includes the >> terminator at the end of each strbuf post splitting. Include an option > > s/Include

Re: [PATCH/RFC 05/10] ref-filter: introduce color_atom_parser()

2015-12-03 Thread Karthik Nayak
On Wed, Dec 2, 2015 at 4:57 AM, Eric Sunshine wrote: > On Wed, Nov 11, 2015 at 2:44 PM, Karthik Nayak wrote: >> Introduce color_atom_parser() which will parse a "color" atom and >> store its color in the "use_atom" structure for further usage in >

Re: [PATCH/RFC 04/10] ref-filter: skip deref specifier in match_atom_name()

2015-12-02 Thread Karthik Nayak
On Wed, Dec 2, 2015 at 4:41 AM, Eric Sunshine wrote: > On Wed, Nov 11, 2015 at 2:44 PM, Karthik Nayak wrote: >> Signed-off-by: Karthik Nayak > > A bit of explanation about why this change is desirable would be > welcome. I'm guessing it's because a future patch

Re: [PATCH] ref-filter: mark some file-local functions static

2015-12-02 Thread Karthik Nayak
> yours. > > Thanks! Thanks, will squash this into the next version. 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/RFC 01/10] ref-filter: introduce a parsing function for each atom in valid_atom

2015-11-26 Thread Karthik Nayak
On Thu, Nov 26, 2015 at 1:11 AM, Eric Sunshine wrote: > On Wed, Nov 25, 2015 at 7:10 AM, Karthik Nayak wrote: >> On Tue, Nov 24, 2015 at 5:14 AM, Eric Sunshine >> wrote: >>> On Wed, Nov 11, 2015 at 2:44 PM, Karthik Nayak >>> wrote: >>>>

[PATCH/RFC 10/10] ref-filter: introduce objectname_atom_parser()

2015-11-25 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. Signed-off-by: Karthik Nayak --- ref-filter.c | 42 +++---

Re: [PATCH/RFC 00/10] ref-filter: use parsing functions

2015-11-25 Thread Karthik Nayak
On Wed, Nov 25, 2015 at 3:18 AM, Jeff King wrote: > On Thu, Nov 12, 2015 at 01:14:26AM +0530, Karthik Nayak wrote: > >> Karthik Nayak (10): >> ref-filter: introduce a parsing function for each atom in valid_atom >> ref-filter: introduce struct used_atom >> ref-

Re: [PATCH/RFC 01/10] ref-filter: introduce a parsing function for each atom in valid_atom

2015-11-25 Thread Karthik Nayak
On Tue, Nov 24, 2015 at 5:14 AM, Eric Sunshine wrote: > On Wed, Nov 11, 2015 at 2:44 PM, Karthik Nayak wrote: >> Introduce a parsing function for each atom in valid_atom. Using this >> we can define special parsing functions for each of the atoms. Since >> we have a thir

Re: What's cooking in git.git (Nov 2015, #03; Fri, 20)

2015-11-22 Thread Karthik Nayak
281180 which I recently sent. So replace "for-each-branch-remainder" with this in "Whats cooking"? -- 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/RFC 04/10] ref-filter: skip deref specifier in match_atom_name()

2015-11-11 Thread Karthik Nayak
Signed-off-by: Karthik Nayak --- ref-filter.c | 4 1 file changed, 4 insertions(+) diff --git a/ref-filter.c b/ref-filter.c index 1542f5f..4af28ef 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -37,6 +37,10 @@ static int match_atom_name(const char *name, const char *atom_name, const char

[PATCH/RFC 09/10] ref-filter: introduce contents_atom_parser()

2015-11-11 Thread Karthik Nayak
Introduce contents_atom_parser() which will parse the '%(contents)' 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 | 66 ++--

[PATCH/RFC 07/10] ref-filter: introduce align_atom_parser()

2015-11-11 Thread Karthik Nayak
%(align:position=middle,width=30)). Add documentation and modify the existing tests in t6302 to reflect the same. Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 18 --- ref-filter.c | 102 +++-- t/t6302-for-each-ref

[PATCH/RFC 06/10] strbuf: introduce strbuf_split_str_without_term()

2015-11-11 Thread Karthik Nayak
a given string into strbufs without including the terminator. Signed-off-by: Karthik Nayak --- ref-filter.c | 5 + strbuf.c | 17 + strbuf.h | 14 ++ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 0523d54..

[PATCH/RFC 03/10] ref-fitler: bump match_atom() name to the top

2015-11-11 Thread Karthik Nayak
Bump match_atom() to the top for usage in further patches. Signed-off-by: Karthik Nayak --- ref-filter.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 748a2fe..1542f5f 100644 --- a/ref-filter.c +++ b/ref

[PATCH/RFC 08/10] ref-filter: introduce remote_ref_atom_parser()

2015-11-11 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. Signed-off-by: Karthik

[PATCH/RFC 05/10] ref-filter: introduce color_atom_parser()

2015-11-11 Thread Karthik Nayak
Introduce color_atom_parser() which will parse a "color" atom and store its color in the "use_atom" structure for further usage in 'populate_value()'. Signed-off-by: Karthik Nayak --- ref-filter.c | 20 1 file changed, 16 insertions(+), 4

[PATCH/RFC 01/10] ref-filter: introduce a parsing function for each atom in valid_atom

2015-11-11 Thread Karthik Nayak
Introduce a parsing function for each atom in valid_atom. Using this we can define special parsing functions for each of the atoms. Since we have a third field in valid_atom structure, we now fill out missing cmp_type values. Signed-off-by: Karthik Nayak --- ref-filter.c | 59

[PATCH/RFC 02/10] ref-filter: introduce struct used_atom

2015-11-11 Thread Karthik Nayak
Introduce the 'used_array' structure which would replace the existing implementation of 'used_array' (which a list of atoms). This helps us parse atom's before hand and store required details into the 'used_array' for future usage. Signed-off-by: Ka

[PATCH/RFC 00/10] ref-filter: use parsing functions

2015-11-11 Thread Karthik Nayak
introduce parsing functions for atoms so that they maybe parsed before hand and the necessary values maybe stored the introduce used_atom structure. Karthik Nayak (10): ref-filter: introduce a parsing function for each atom in valid_atom ref-filter: introduce struct used_atom ref-fitler: bump

[PATCH v4] ref-filter: fallback on alphabetical comparison

2015-10-30 Thread Karthik Nayak
we can now depend on being stable. Helped-by: Junio C Hamano Reported-by: Johannes Sixt Signed-off-by: Karthik Nayak --- ref-filter.c | 2 +- t/t3203-branch-output.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index 046e73b..

Re: [PATCH v3] ref-filter: fallback on alphabetical comparison

2015-10-29 Thread Karthik Nayak
On Thu, Oct 29, 2015 at 3:46 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> On Wed, Oct 28, 2015 at 1:20 AM, Junio C Hamano wrote: >>>> Hence, fallback to alphabetical comparison based on the refname >>>> whenever the other criterion is equal. Fix t

Re: [PATCH v3] ref-filter: fallback on alphabetical comparison

2015-10-28 Thread Karthik Nayak
, which we can now depend > on being stable. > > I am not sure about "HEAD" and "branch-two" in the above (it may be > comparison between "HEAD" and "refs/heads/branch-two", for example). > It actually is, we consider "refs/heads/

[PATCH v3] ref-filter: fallback on alphabetical comparison

2015-10-27 Thread Karthik Nayak
equal values cannot be pre-determined) as pointed out by Johannes Sixt ($gmane/280117). Hence, fallback to alphabetical comparison based on the refname whenever the other criterion is equal. Fix the test in t3203 in this regard. Reported-by: Johannes Sixt Signed-off-by: Karthik Nayak --- ref

Re: [PATCH v2] ref-filter: fallback on alphabetical comparison

2015-10-26 Thread Karthik Nayak
On Mon, Oct 26, 2015 at 6:43 AM, Eric Sunshine wrote: > On Sun, Oct 25, 2015 at 12:29 PM, Karthik Nayak wrote: >> In ref-filter.c the comparison of refs while sorting is handled by >> cmp_ref_sorting() function. When sorting as per numerical values >> (e.g. --sort=ob

[PATCH v2] ref-filter: fallback on alphabetical comparison

2015-10-25 Thread Karthik Nayak
equal values cannot be pre-determined) as pointed out by Johannes Sixt ($gmane/280117). Hence, fallback to alphabetical comparison based on the refname whenever the other criterion is equal. Fix the test in t3203 in this regard. Reported-by: Johannes Sixt Signed-off-by: Karthik Nayak --- ref

Re: [PATCH] ref-filter: fallback on alphabetical comparison

2015-10-25 Thread Karthik Nayak
On Sun, Oct 25, 2015 at 5:48 AM, Eric Sunshine wrote: > On Sat, Oct 24, 2015 at 10:42 AM, Karthik Nayak wrote: >> In ref-filter.c the comparison of refs while sorting is handled by >> cmp_ref_sorting() function. When sorting as per numerical values >> (e.g. --sort=ob

[PATCH] ref-filter: fallback on alphabetical comparison

2015-10-24 Thread Karthik Nayak
/280117). Hence, fallback to alphabetical comparison based on the refname whenever the other criterion is equal. Fix the test in t3203 in this regard. Signed-off-by: Karthik Nayak --- ref-filter.c | 2 +- t/t3203-branch-output.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions

Re: t3203: --sort=objectsize failure on Windows

2015-10-24 Thread Karthik Nayak
erhaps cmp_ref_sorting() should fall back > to alphabetic comparison if the other criterion (when used) compares equal? > Seems like a simple and good way to go around this. will reply with a patch. -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line "unsubscribe git&qu

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

2015-10-20 Thread Karthik Nayak
arsing part of it before this 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

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

2015-10-18 Thread Karthik Nayak
f code around and this had me thinking it's perhaps easier to do the cleaning up first as Junio suggested. Maybe then it'd be simpler to do implement this rather than move code around now and then move code around when we implement the parsing methods we spoke about earlier? -- Regards,

[PATCH v2] tag.c: use the correct algorithm for the '--contains' option

2015-10-18 Thread Karthik Nayak
r->with_commit_tag_algo' bit. As reported by Jerry Snitselaar, this causes the '--contains' option to work way slower than expected, fix this by setting 'filter->with_commit_tag_algo' in tag.c before calling 'filter_refs()'. Mentored-by: Matthieu Moy Tested-

Re: git tag --contains now takes a long time

2015-10-18 Thread Karthik Nayak
On Sun, Oct 18, 2015 at 2:58 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> So I did poke around a little. I think I missed this out on the >> original commit (b7cc53e92c806b73e14b03f60c17b7c29e52b4a4). >> >> diff --git a/builtin/tag.c b/builtin/tag.c &g

[PATCH] tag.c: use the correct algorithm for the '--contains' option

2015-10-17 Thread Karthik Nayak
Jerry Snitselaar, this causes the option to work way slower than expected, fix this by setting 'filter->with_commit_tag_algo' in tag.c before calling 'filter_refs()'. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak Tested-by: Jerr

Re: git tag --contains now takes a long time

2015-10-17 Thread Karthik Nayak
On Sat, Oct 17, 2015 at 9:28 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> Could you Squash that in, Junio? > > The guilty commit is in master, so you'll need a new commit to fix the > old one. Can you send a patch with a proper c

Re: git tag --contains now takes a long time

2015-10-16 Thread Karthik Nayak
version > git version 2.5.0.275.gac4cc86 > > snits ~/dev/linux> time git tag --contains 825fcfc > next-20151012 > next-20151013 > v4.3-rc5 > > real0m12.842s > user0m11.536s > sys 0m1.098s > > > b7cc53e92c806b73e14b03f60c17b7c29e52b4a4 is the first bad comm

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

2015-10-13 Thread Karthik Nayak
the above series. >> After reading Matthieu's and Junio's discussion, I lean towards the latter. > > Leaving it as-is does not fit in my arguments to do the refactoring > later. It's not introducing "another instance of an existing pattern", > but actually

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

2015-10-13 Thread Karthik Nayak
On Thu, Oct 8, 2015 at 2:48 PM, Karthik Nayak wrote: > Add support for %(upstream:track,nobracket) which will print the > tracking information without the brackets (i.e. "ahead N, behind M"). > > Add test and documentation for the same. > --- > Documentati

Re: [PATCH v2 09/10] branch: use ref-filter printing APIs

2015-10-13 Thread Karthik Nayak
On Tue, Oct 13, 2015 at 10:01 PM, Junio C Hamano wrote: > Karthik Nayak writes: > >> 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. &g

Re: [PATCH 1/3] fixup: use xstrfmt instead of fixed-size buf + sprintf + xstrdup

2015-10-12 Thread Karthik Nayak
/war-on-sprintf topic, but the new code since that > commit cleaned up. > Yes, pretty much the same. > I'd expect that this will be rolled into Karthik's series in the > next reroll? > > Looking good. Thanks. Yes, I've adding this into my series. -- Regards, Kart

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

2015-10-12 Thread Karthik Nayak
On Mon, Oct 12, 2015 at 6:06 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> On Fri, Oct 9, 2015 at 11:59 PM, Junio C Hamano wrote: >> ... >> Also does it make sense to integrate these changes here? Or would you like to >> have another series on this? > &

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

2015-10-11 Thread Karthik Nayak
On Sun, Oct 11, 2015 at 11:40 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> A little blurry on how this works, as in how translation takes place, >> probably need to look at some code. > > What you really need to understand is: _("foo") is translated,

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

2015-10-11 Thread Karthik Nayak
On Mon, Oct 12, 2015 at 1:02 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Sun, Oct 11, 2015 at 9:51 PM, Matthieu Moy >> wrote: >>> Karthik Nayak writes: >>> >>>> Also does it make sense to integrate these changes here? Or would yo

Re: [PATCH 2/3] ref-filter: allow porcelain to translate messages in the output

2015-10-11 Thread Karthik Nayak
m_theirs); > else > v->s = xstrfmt("[ahead %d, > behind %d]", > diff --git a/ref-filter.h b/ref-filter.h > index 0014b92..2cce02c 100644 > --- a/ref-filter.h > +++ b/ref-filter.h

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

2015-10-11 Thread Karthik Nayak
On Sun, Oct 11, 2015 at 9:51 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> Also does it make sense to integrate these changes here? Or would you like to >> have another series on this? > > To me, the important in this series is to avoid introducing duplicated

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

2015-10-11 Thread Karthik Nayak
On Sun, Oct 11, 2015 at 9:42 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Fri, Oct 9, 2015 at 12:10 AM, Matthieu Moy >> wrote: >>> Karthik Nayak writes: >>> >>>> --- a/ref-filter.c >>>> +++ b/ref-filter.c >>>>

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

2015-10-11 Thread Karthik Nayak
On Sun, Oct 11, 2015 at 9:35 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >>>> diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh >>>> index 7c9bec7..6fc569e 100755 >>>> --- a/t/t6300-for-each-ref.sh >>>>

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

2015-10-11 Thread Karthik Nayak
t;modifier[no].part0 = xstrndup(sp, equal - sp); atom->modifier[no].part1 = xstrndup(equal + 1, ep - equal - 1); } sp = ep; } } } or something on these lines for what you suggested. We could improve by having a special parsing function for sel

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

2015-10-10 Thread Karthik Nayak
On Fri, Oct 9, 2015 at 12:10 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> --- a/ref-filter.c >> +++ b/ref-filter.c >> @@ -1118,8 +1118,10 @@ static void populate_value(struct ref_array_item *ref) >> char buf[40]; >>

Re: [PATCH v2 05/10] ref-filter: adopt get_head_description() from branch.c

2015-10-10 Thread Karthik Nayak
On Fri, Oct 9, 2015 at 12:31 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> Copy the implementation of get_head_description() from branch.c. This >> gives a description of the HEAD ref if called. This is used as the >> refname for the HEAD ref whenever the FILTER_R

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

2015-10-10 Thread Karthik Nayak
On Fri, Oct 9, 2015 at 12:28 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> --- a/ref-filter.c >> +++ b/ref-filter.c >> @@ -464,14 +464,28 @@ static void *get_obj(const unsigned char *sha1, struct >> object **obj, unsigned lo >> static int grab_objectn

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

2015-10-10 Thread Karthik Nayak
On Fri, Oct 9, 2015 at 12:21 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> @@ -309,11 +319,19 @@ static void then_atom_handler(struct atom_value >> *atomv, struct ref_formatting_st >> if (if_then_else->then_atom) >> die(_("for

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

2015-10-10 Thread Karthik Nayak
On Fri, Oct 9, 2015 at 12:49 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> --- a/Documentation/git-for-each-ref.txt >> +++ b/Documentation/git-for-each-ref.txt >> @@ -134,9 +134,17 @@ align:: >> `` is either left, right or middle, default being >

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

2015-10-10 Thread Karthik Nayak
On Fri, Oct 9, 2015 at 12:18 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> +static void if_then_else_handler(struct ref_formatting_stack **stack) >> +{ >> + struct ref_formatting_stack *cur = *stack; >> + struct ref_formatting_stack *prev = cur->p

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

2015-10-08 Thread Karthik Nayak
On Thu, Oct 8, 2015 at 10:40 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Thu, Oct 8, 2015 at 5:57 PM, Matthieu Moy >> wrote: >>>> + unsigned int nobracket = 0; >>>> + >>>> +

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

2015-10-08 Thread Karthik Nayak
of comma-separated values, the only other place we use that is in the align atom. Also I find this very specific to get a function out of. Somehow I think this is the simplest way to go about this. -- Regards, Karthik Nayak -- To unsubscribe from this list: send the line "unsubscribe git&qu

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

2015-10-08 Thread Karthik Nayak
On Thu, Oct 8, 2015 at 5:57 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> +An example to show the usage of %(if)...%(then)...%(else)...%(end). >> +This prefixes the current branch with a star. >> + >> + >> +#!/bin/sh >> + >>

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

2015-10-08 Thread Karthik Nayak
Add the options `:dir` and `:base` to the %(refname) atom. The `:dir` option gives the directory (the part after $GIT_DIR/) of the ref without the refname. The `:base` option gives the base directory of the given ref (i.e. the directory following $GIT_DIR/refs/). Add tests and documentation for th

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

2015-10-08 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 38e4424.

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

2015-10-08 Thread Karthik Nayak
Add support for %(upstream:track,nobracket) which will print the tracking information without the brackets (i.e. "ahead N, behind M"). Add test and documentation for the same. --- Documentation/git-for-each-ref.txt | 6 -- ref-filter.c | 28 +++-

[PATCH v2 09/10] branch: use ref-filter printing APIs

2015-10-08 Thread Karthik Nayak
these changes. Change calc_maxwidth() to also account for the length of HEAD ref, by calling ref-filter:get_head_discription(). Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 261

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

2015-10-08 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 v2 05/10] ref-filter: adopt get_head_description() from branch.c

2015-10-08 Thread Karthik Nayak
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 | 4 ref-filter.c | 38 -- ref-filter.h | 2 ++ 3 files

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

2015-10-08 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 04/10] ref-filter: modify "%(objectname:short)" to take length

2015-10-08 Thread Karthik Nayak
Add support for %(objectname:short=) which would print the abbreviated unique objectname of given length. When no length is specified 7 is used. The minimum length is 4. Add tests and documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik

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

2015-10-08 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 | 4 +++- ref-filter.c | 28 +

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

2015-10-08 Thread Karthik Nayak
-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 47 +- ref-filter.c | 127 +++-- t/t6302-for-each-ref-filter.sh | 67 +++ 3 files changed, 231 insertions(+), 10 deletions(-) diff --git a

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

2015-10-08 Thread Karthik Nayak
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 ref-filter's printing options. The previous version of the patch can be found at: http://article.gmane.org/gmane.comp.version-control.git/278926 Karthik Na

Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-07 Thread Karthik Nayak
On Wed, Oct 7, 2015 at 11:28 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Wed, Oct 7, 2015 at 12:33 AM, Matthieu Moy >> wrote: >> >>> To go a bit further, you can pre-build a string or strbuf aligned_short >>> with value like "%%(ali

Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-07 Thread Karthik Nayak
On Wed, Oct 7, 2015 at 12:33 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> If you look closely, thats only for the local branches, the remotes >> have `align` atom when >> printing in verbose. > > Yes, but that's already one thing factored out of th

Re: [PATCH 6/9] ref-filter: introduce format_ref_array_item()

2015-10-06 Thread Karthik Nayak
On Wed, Oct 7, 2015 at 1:08 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Mon, Oct 5, 2015 at 2:19 PM, Matthieu Moy >> wrote: >>> Karthik Nayak writes: >>>> which does not play well with the implementation of --column as done >>>> in

Re: [PATCH 6/9] ref-filter: introduce format_ref_array_item()

2015-10-06 Thread Karthik Nayak
On Mon, Oct 5, 2015 at 2:19 PM, Matthieu Moy wrote: > Karthik Nayak writes: >> which does not play well with the implementation of --column as done >> in tag.c. Where, If I'm not wrong the --column option captures all >> output, formats it and then prints it to stdout.

Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-06 Thread Karthik Nayak
On Tue, Oct 6, 2015 at 12:13 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> On Sat, Oct 3, 2015 at 6:11 PM, Matthieu Moy >> wrote: >>> Actually, this is not a performance-cricical piece of code at all, so I >>> think it's even better to build an s

Re: [PATCH 8/9] branch: use ref-filter printing APIs

2015-10-05 Thread Karthik Nayak
On Sat, Oct 3, 2015 at 6:11 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> - if (upstream_is_gone) { >> - if (show_upstream_ref) >> - strbuf_addf(stat, _("[%s: gone]"), fancy.buf); > > The old string was translated

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

2015-10-05 Thread Karthik Nayak
On Sat, Oct 3, 2015 at 5:38 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> diff --git a/ref-filter.c b/ref-filter.c >> index 099acd6..48b06e3 100644 >> --- a/ref-filter.c >> +++ b/ref-filter.c >> @@ -1133,8 +1133,10 @@ static void popul

Re: [PATCH 6/9] ref-filter: introduce format_ref_array_item()

2015-10-05 Thread Karthik Nayak
On Sat, Oct 3, 2015 at 5:32 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> Introduce format_ref_array_item() which will output the details of a >> given ref_array_item as per the given format and quote_style to the >> given strbuf. > > Why do you need it i

Re: [PATCH 3/9] ref-filter: add support for %(path) atom

2015-10-04 Thread Karthik Nayak
ls the > formatting machinery what kind of derivation is desired? > > If so would %(refname:dir) & %(refname:base) be more in line with > the overall structure? This seems way better, I like these names more. On Sun, Oct 4, 2015 at 11:21 PM, Matthieu Moy wrote: > Karthik Nay

Re: [PATCH 3/9] ref-filter: add support for %(path) atom

2015-10-04 Thread Karthik Nayak
On Sat, Oct 3, 2015 at 3:32 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> This adds %(path) and %(path:short) atoms. The %(path) atom will print >> the path of the given ref, while %(path:short) will only print the >> subdirectory of the given ref. > >

Re: [PATCH 1/9] ref-filter: implement %(if), %(then), and %(else) atoms

2015-10-04 Thread Karthik Nayak
On Sat, Oct 3, 2015 at 3:09 PM, Matthieu Moy wrote: > Karthik Nayak writes: > >> Implement %(if), %(then) and %(else) atoms. Used as >> %(if)..%(then)..%(end) or %(if)..%(then)..%(else)..%(end). > > I prefer ... to .., which often means "interval" as in HEAD^^

Re: [PATCH 4/9] ref-filter: modify "%(objectname:short)" to take length

2015-10-03 Thread Karthik Nayak
On Sat, Oct 3, 2015 at 2:32 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> Add support for %(objectname:short,) which would print the >> abbreviated unique objectname of given length. When no length is >> specified 7 is used. The minimum length is 4. > > It

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

2015-10-03 Thread Karthik Nayak
On Sat, Oct 3, 2015 at 2:24 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> 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 ''. >> >>

Re: [PATCH 1/9] ref-filter: implement %(if), %(then), and %(else) atoms

2015-10-03 Thread Karthik Nayak
On Sat, Oct 3, 2015 at 2:15 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> +static int is_empty(const char * s){ >> + while (*s != '\0') { >> + if (!isspace(*s)) >> + return 0; >> + s++; >&g

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

2015-10-02 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 | 4 +++- ref-filter.c | 28 +

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

2015-10-02 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 1/9] ref-filter: implement %(if), %(then), and %(else) atoms

2015-10-02 Thread Karthik Nayak
: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 23 +++- ref-filter.c | 116 ++--- t/t6302-for-each-ref-filter.sh | 48 +++ 3 files changed, 177 insertions(+), 10 deletions(-) diff --git a

[PATCH 8/9] branch: use ref-filter printing APIs

2015-10-02 Thread Karthik Nayak
#x27; now prints the upstream and its tracking details separately as "[] []" instead of "[: ]". Make changes in /t/t6040-tracking-info.sh to reflect the change. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Na

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

2015-10-02 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 099acd6.

[PATCH 0/9] port branch.c to use ref-filter printing APIs

2015-10-02 Thread Karthik Nayak
g. This seems overly complex to the uninitiated as it uses a complex atom combinations to mimic the existing branch printing format. Karthik Nayak (9): ref-filter: implement %(if), %(then), and %(else) atoms ref-filter: implement %(if:equals=) and %(if:notequals=) ref-filter:

[PATCH 5/9] ref-filter: adopt get_head_description() from branch.c

2015-10-02 Thread Karthik Nayak
Copy the implementation of get_head_description() from branch.c. 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. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik

[PATCH 6/9] ref-filter: introduce format_ref_array_item()

2015-10-02 Thread Karthik Nayak
strbuf and prints it the standard output. This is needed when we port over the printing options of ref-filter to branch.c. 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 3/9] ref-filter: add support for %(path) atom

2015-10-02 Thread Karthik Nayak
This adds %(path) and %(path:short) atoms. The %(path) atom will print the path of the given ref, while %(path:short) will only print the subdirectory of the given ref. Add tests and documentation for the same. --- Documentation/git-for-each-ref.txt | 5 + ref-filter.c

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

2015-10-02 Thread Karthik Nayak
Add support for %(objectname:short,) which would print the abbreviated unique objectname of given length. When no length is specified 7 is used. The minimum length is 4. Add tests and documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik

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

2015-09-25 Thread Karthik Nayak
On Fri, Sep 25, 2015 at 9:30 PM, Junio C Hamano wrote: > Matthieu Moy writes: > >> Karthik Nayak writes: >> >>> Remove the error "branch '%s' does not point at a commit" in >>> apppend_ref() which reports branch refs which do not point to

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

2015-09-24 Thread Karthik Nayak
ref-filter ignores refs which do not point at commits silently. Based-on-patch-by: Jeff King Helped-by: Junio C Hamano Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 18 -- 1 file changed, 4 insertions(+), 14 dele

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

2015-09-23 Thread Karthik Nayak
On Thu, Sep 24, 2015 at 12:44 AM, Junio C Hamano wrote: > Karthik Nayak writes: > >> Remove the error reporting variable to make the code easier to port >> over to using ref-filter APIs. >> >> This also removes the error from being displayed. As branch.c will

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

2015-09-23 Thread Karthik Nayak
On Thu, Sep 24, 2015 at 12:27 AM, Matthieu Moy wrote: > Karthik Nayak writes: > >> Remove the error reporting variable to make the code easier to port >> over to using ref-filter APIs. >> >> This also removes the error from being displayed. As branch.c will

Re: [PATCH v6 0/8] port branch.c to use the filtering part of ref-filter.

2015-09-23 Thread Karthik Nayak
actual lossage of the error message shown to the user. > That needs to be changed, I'll reply with a changed commit, 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 M

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

2015-09-23 Thread Karthik Nayak
f-filter' completely. As this is a temporary step, most of the code introduced here will be removed when 'branch.c' is ported over to use 'ref-filter' APIs. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 317

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

2015-09-23 Thread Karthik Nayak
ref-filter. Modify some of the tests in t1430 to check the stderr for a warning regarding the broken ref. This is done as ref-filter throws a warning for broken refs rather than directly printing them. Add tests and documentation for the same. Mentored-by: Chri

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

2015-09-23 Thread Karthik Nayak
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 documentation and tests for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --

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