Re: [PATCH 1/5] ref-filter: support different email formats
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 28, 2020, 20:43 UTC
- Message-ID
- <xmqqzh7jcqv7.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CA+CkUQ9nqW8=GuvNapsySf=EXm8c02qKV2xMrwvRY-Kd9Yy9mA@mail.gmail.com>
Hariom verma <hariom18599@gmail.com> writes:
Show 17 quoted lines
>> 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:<whatever>" can benefit from >> studying and mimicking existing practices a bit more? >> > > For "email:<whatever>", > even If I parse that <whatever>. 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 "<basicatom>:<modifiers>" like "objectname:short" etc are handled, not before, I think.