Re: [PATCH 5/5] commit-graph: show usage on "commit-graph [write|verify] garbage"
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Feb 15, 2021, 19:06 UTC
- Message-ID
- <YCrGQPaAs2KGeCBG@nand.local>
- In-Reply-To
- <20210215184118.11306-6-avarab@gmail.com>
On Mon, Feb 15, 2021 at 07:41:18PM +0100, Ævar Arnfjörð Bjarmason wrote:
Show 7 quoted lines
> Change the parse_options() invocation in the commit-graph code to make > sense. We're calling it twice, once for common options parsing, and > then for the sub-commands. > > But we never checked if we had something leftover in argc in "write" > or "verify", as a result we'd silently accept garbage in these > subcommands. Let's not do that.
...Implicit in all of this is that we need to pass PARSE_OPT_KEEP_UNKNOWN to have the sub-commands' call to parse_options() leave extra cruft alone so we can check for its existence with an "if (argc)".
Makes sense, thanks.
Thanks, Taylor