Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes: > ...an alternative would have been something like: > > else if (!strcmp(arg, "trailers")) { > if (trailers_atom_parser(format, atom, NULL, err)) > return -1; > } else if (skip_prefix(arg, "trailers:", &arg)) { > if (trailers_atom_parser(format, atom, arg, err)) > return -1; > } > > which is quite simple to reason about (though has the cost of a tiny > bit of duplication). Yeah, that looks quite simple and straight-forward. >> diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh >> @@ -823,6 +823,15 @@ test_expect_success '%(trailers) rejects unknown trailers arguments' ' >> +test_expect_success 'if arguments, %(contents:trailers) shows error if semicolon is missing' ' > > s/semicolon/colon/ Definitely. > >> + # error message cannot be checked under i18n > > What is this comment about? I realize that you copied it from other > nearby tests, but I find that it muddies rather than clarifies. Yup. If a patch changes test_cmp with test_i18ncmp, the above message belongs to its commit log message, but it is overkill to have it as an in-line comment in every place where test_i18ncmp gets used. Thanks for a review. >> + cat >expect <<-EOF && >> + fatal: unrecognized %(contents) argument: trailersonly >> + EOF >> + test_must_fail git for-each-ref --format="%(contents:trailersonly)" 2>actual && >> + test_i18ncmp expect actual >> +'