From: Eric Sunshine Date: Fri, 05 Feb 2016 00:05:06 GMT Subject: Re: [PATCH v4 10/12] ref-filter: introduce remote_ref_atom_parser() Message-ID: <20160205000506.GA6417@flurp.local> In-Reply-To: <1454262176-6594-11-git-send-email-Karthik.188@gmail.com> On Sun, Jan 31, 2016 at 11:12:54PM +0530, Karthik Nayak wrote: > 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 Nayak > --- > diff --git a/ref-filter.c b/ref-filter.c > @@ -50,6 +52,20 @@ static void color_atom_parser(struct used_atom *atom, const char *color_value) > +static void remote_ref_atom_parser(struct used_atom *atom, const char *arg) > +{ > + if (!arg) { > + atom->u.remote_ref = RR_NORMAL; > + } else if (!strcmp(arg, "short")) Style: drop unnecessary braces > + atom->u.remote_ref = RR_SHORTEN; > + else if (!strcmp(arg, "track")) > + atom->u.remote_ref = RR_TRACK; > + else if (!strcmp(arg, "trackshort")) > + atom->u.remote_ref = RR_TRACKSHORT; > + else > + die(_("unrecognized format: %%(%s)"), atom->name); > +}