Re: [PATCH v3 4/4] Documentation: add lint-fsck-msgids
- From
Jeff King <peff@peff.net>
- Date
- Oct 28, 2022, 05:35 UTC
- Message-ID
- <Y1tqOCh+FwoQezYu@coredump.intra.peff.net>
- In-Reply-To
- <221028.86k04k8wbk.gmgdl@evledraar.gmail.com>
On Fri, Oct 28, 2022 at 05:11:07AM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 7 quoted lines
> - The docs are way easier to scrape with some sed/awk/grep/whatever > few-liner than to scrape C code for generating docs. E.g. see > config-list.h. > > - Scraping the C code sucks so much that we'd probably make some > dedicated interface for it, e.g. what we have for "git <cmd> > --git-completion-helper".
In the general case, scraping C code is awful. But if you are looking for one particular thing, it is not unreasonable to say something like "when we write a usage string, we write it like:
const char *git_cmdname_usage[] = "...";
> But mainly it helps to have a use-case, replacing the linter script with > e.g. the *.sh I demo'd might be a marginal improvement. But e.g. "git > help -c" uses one of those generated files (config-list.h), and actually > does something useful ...
Yeah. In cases like config-list.h, it really is helpful for it to be something we can query at run-time (the other option would be stuffing them into git-completion.bash at build-time, but there are some downsides there).
-Peff