From: Karthik Nayak Date: Sat, 06 Feb 2016 18:44:09 GMT Subject: Re: [PATCH v4 10/12] ref-filter: introduce remote_ref_atom_parser() Message-ID: In-Reply-To: <20160205000506.GA6417@flurp.local> On Fri, Feb 5, 2016 at 5:35 AM, Eric Sunshine wrote: > 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 > Will do. >> + 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); >> +} -- Regards, Karthik Nayak