rev-list: update a NEEDSWORK comment

The comment is poorly phrased and it in't clear what it wanted to
say.  Strongly discourage this broken pattern to be copied and
pasted to other code paths.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Junio C Hamano 2025-07-21 15:46:42 -07:00
parent 16bd9f20a4
commit f31abb421d
1 changed files with 13 additions and 9 deletions

View File

@ -650,17 +650,21 @@ int cmd_rev_list(int argc,
* *
* Let "--missing" to conditionally set fetch_if_missing. * Let "--missing" to conditionally set fetch_if_missing.
*/ */

/* /*
* NEEDSWORK: These loops that attempt to find presence of * NEEDSWORK: The next loop is utterly broken. It tries to
* options without understanding that the options they are * notice an option is used, but without understanding if each
* skipping are broken (e.g., it would not know "--grep * option takes an argument, which fundamentally would not
* work. It would not know "--grep
* --exclude-promisor-objects" is not triggering * --exclude-promisor-objects" is not triggering
* "--exclude-promisor-objects" option). We really need * "--exclude-promisor-objects" option, for example.
* setup_revisions() to have a mechanism to allow and disallow *
* some sets of options for different commands (like rev-list, * We really need setup_revisions() to have a mechanism to
* replay, etc). Such a mechanism should do an early parsing * allow and disallow some sets of options for different
* of options and be able to manage the `--missing=...` and * commands (like rev-list, replay, etc). Such a mechanism
* `--exclude-promisor-objects` options below. * should do an early parsing of options and be able to manage
* the `--missing=...` and `--exclude-promisor-objects`
* options below.
*/ */
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
const char *arg = argv[i]; const char *arg = argv[i];