Re: [PATCH v3 0/5] Skip 'cache_tree_update()' when 'prime_cache_tree()' is called immediate after
From: SZEDER Gábor <hidden>
Date: 2022-11-10 19:50:38
From: SZEDER Gábor <hidden>
Date: 2022-11-10 19:50:38
On Thu, Nov 10, 2022 at 07:06:00PM +0000, Victoria Dye via GitGitGadget wrote:
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.