Re: [PATCH 2/2] [GSOC] ref-filter: add %(raw) atom
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Jun 4, 2021, 10:59 UTC
- Message-ID
- <CAOLTT8SX-Ae-WrnXkGQPXA4dVdfX1VDKC=411L__DUkJc77d-A@mail.gmail.com>
- In-Reply-To
- <xmqq35ty6391.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> 于2021年6月4日周五 上午5:35写道:
Show 15 quoted lines
> > The point is that you can piggyback existing string comparison > (which is called "parsing") and use the parsed result (i.e. if you > can compare with ATOM_RAW instead of adding another strcmp(), that > can be a better solution). > > That only says using parse_sorting_atom() and relying on the check > in the function is still too early, and does not necessarily support > the posted patch that redundantly runs strcmp(). > > After parsing all the command line options, we have used_atom[] > fully populated and we know what host language we are quoting the > result for---and that makes a good place to check for comflicting > requests. >
Alright, I got it: we can perform related check in verify_ref_format(), after parse_ref_filter_atom(), It is a good checkpoint.
Show 5 quoted lines
> > After all, the reason why this must be done here is the ref-filter > > original logic > > has not considered rejecting a format atom and an option. > > That is something you can fix to make the code easier to follow, no?
You are right. ;-)
Thanks. -- ZheNing Hu