From: Christian Couder Date: Thu, 04 Jun 2026 08:27:35 GMT Subject: Re: [PATCH 2/2] builtin/add: use die_for_required_opt() helper Message-ID: In-Reply-To: <20260603111044.39116-3-r.siddharth.shrimali@gmail.com> On Wed, Jun 3, 2026 at 1:11 PM Siddharth Shrimali wrote: > > Clean up manual option dependency checks by replacing explicit conditional > blocks with the newly introduced die_for_required_opt() helper function. > > Specifically, simplify the prerequisite check logic for both > '--ignore-missing' (which requires '--dry-run') and '--pathspec-file-nul' > (which requires '--pathspec-from-file'). It's a good idea to use the new helper function for '--pathspec-file-nul' requiring '--pathspec-from-file' because it looks like this is tested a lot already: $ git grep requires | grep 'the option' t2026-checkout-pathspec-file.sh: test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err t2072-restore-pathspec-file.sh: test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && t3601-rm-pathspec-file.sh: test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && t3704-add-pathspec-file.sh: test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && t3909-stash-pathspec-file.sh: test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err t7107-reset-pathspec-file.sh: test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && t7526-commit-pathspec-file.sh: test_grep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && You could mention this in the commit message. Also it might be worth squashing this patch into the previous one. Thanks.