From: Junio C Hamano Date: Tue, 28 Jul 2020 20:43:40 GMT Subject: Re: [PATCH 1/5] ref-filter: support different email formats Message-ID: In-Reply-To: Hariom verma writes: >> The ref-filter formatting language already knows many "colon plus >> modifier" suffix like "refname:short" and "contents:body", but I do >> not think we have ugly repetition like the above code to parse them. >> Perhaps the addition for "email:" can benefit from >> studying and mimicking existing practices a bit more? >> > > For "email:", > even If I parse that . I still make comparison something like: > ``` > if (!modifier) > email_option.option = EO_RAW; > else if (!strcmp(modifier, "trim")) > email_option.option = EO_TRIM; > else if (!strcmp(arg, "localpart")) > email_option.option = EO_LOCALPART; > ``` Somebody needs to do a comparison, but it should be done at parsing phase when the --format is grokked, not in grab phase that is run for each and every ref to be shown. These patches should only be done after looking at existing ":" like "objectname:short" etc are handled, not before, I think.