Re: [PATCH] test-chmtime: use parse_options() to parse command-line flags
- From
- Shashank S <shashu8660@gmail.com>
- Date
- Oct 29, 2026, 05:54 UTC
- Message-ID
- <CANHmUQRO1z1hL-L-To3_5n77P9V=GQAhN5cJ8BdDewP9sNqEYA@mail.gmail.com>
- In-Reply-To
- <xmqqv76nj7ys.fsf@gitster.g>
On Wed, 28 Oct 2026 at 00:18, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> > "Shashank S via GitGitGadget" <gitgitgadget@gmail.com> writes: > > > > > t/helper/test-chmtime.c | 46 +++++++++++++++++++---------------------- > > 1 file changed, 21 insertions(+), 25 deletions(-) > > Forgot to mention one thing. Do we have any tests to cover the > behaviour of this test helper? If not, should we add some (not a > rhetorical question)? > > Also, one thing I missed is that the original ignored --verbose > when --get was given, since they contradict with each other. > Shouldn't we make them explicitly incompatible with each other, > perhaps before where we call timespec_arg()? >
This is a great catch. While `test-chmtime` is heavily utilized in scripts like `t5304-prune.sh`, there are no tests covering the helper's actual argument parsing.
In my v2, I will add `die_for_incompatible_opt2()` immediately after `parse_options()`, and I will include a second patch in the series that adds a dedicated `t/t00xx-test-chmtime.sh` script to explicitly test the `--get`/`--verbose` incompatibility and the standard usage.
Thanks again for the excellent guidance
Shashank s mogaveera