Re: [PATCH v3 0/5] Skip 'cache_tree_update()' when 'prime_cache_tree()' is called immediate after
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Nov 10, 2022, 19:50 UTC
- Message-ID
- <20221110195029.GD1159673@szeder.dev>
- In-Reply-To
- <pull.1411.v3.git.1668107165.gitgitgadget@gmail.com>
On Thu, Nov 10, 2022 at 07:06:00PM +0000, Victoria Dye via GitGitGadget wrote:
Show 11 quoted lines
> Changes since V2 > ================ > > * Cleaned up option handling & provided more informative error messages in > 'test-tool cache-tree'. The changes don't affect any behavior in the > added tests & 'test-tool cache-tree' won't be used outside of > development, but the improvements here will help future readers avoid > propagating error-prone implementations. > * Note that the suggestion to change the "unknown subcommand" error to a > 'usage()' error was not taken, as it would be somewhat cumbersome to > use a formatted string with it.
I'm not sure I understand what's cumbersome. It's as simple as:
if (...) {
error(_("unknown subcommand: `%s'"), argv[0]);
usage_with_options(test_cache_tree_usage, options);
}> This is in line with other custom > subcommand parsing in Git, such as in 'fsmonitor--daemon.c'.
The option parsing in 'fsmonitor--daemon.c' is broken, please don't consider it as an example to follow.