Re: [PATCH] add usage-strings ci check and amend remaining usage strings
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 22, 2022, 10:57 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2202221152230.11118@tvgsbejvaqbjf.bet>
- In-Reply-To
- <20220221173357.8622-1-chakrabortyabhradeep79@gmail.com>
Hi Julia,
I would like to loop you in here because you have helped us with Coccinelle questions in the past.
On Mon, 21 Feb 2022, Abhradeep Chakraborty wrote:
Show 10 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
>
> > That should be fairly easy to do though, and if not we could always
> > just dump these to stderr or something if a
> > git_env_bool("GIT_TEST_PARSE_OPTIONS_DUMP_FIELD_HELP", 0) was true,
> > and do the testing itself in t0012-help.sh.
>
> Okay but if the logic can't be implented in the `parse-options.c` file
> (most probably I will be able to implement the logic), would you allow
> me to try the `coccinelle script` method you mentioned?The task at hand is to identify calls to the macro `OPT_CMDMODE()` (and other, similar macros) that get a fourth argument of the form
N_("<some string>")The problem is to identify `<some string>` that ends in a `.` (which we want to avoid) or that starts with some prefix and a colon but follows with an upper-case character.
In other words, we want to suggest replacing
N_("log: Use something")or
N_("log: use something.")by
N_("log: use something")Ævar suggested that Coccinelle can do that. Could you give us a hand how this would be possible using `spatch`?
Thank you, Johannes