Re: [PATCH 2/2] [GSOC] ref-filter: add %(raw) atom
From: ZheNing Hu <hidden>
Date: 2021-06-04 11:00:31
Junio C Hamano [off-list ref] 于2021年6月4日周五 上午5:35写道:
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.
quoted
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