Re: [PATCH v6 00/14] Introduce new `git replay` command
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 8, 2023, 12:19 UTC
- Message-ID
- <cbeabc59-6d2c-a4a6-f7a2-394d72ee7bd3@gmx.de>
- In-Reply-To
- <CABPp-BE6G2qaF50bhz-CwxSsvxGDHzwvsWtfQO4zVcX6ERppLw@mail.gmail.com>
Hi,
On Mon, 6 Nov 2023, Elijah Newren wrote:
Show 24 quoted lines
> On Thu, Nov 2, 2023 at 6:52 AM Christian Couder
> <christian.couder@gmail.com> wrote:
> >
> [...]
>
> > @@ builtin/replay.c: int cmd_replay(int argc, const char **argv, const char *prefix
> > -
> > strvec_pushl(&rev_walk_args, "", argv[2], "--not", argv[1], NULL);
> >
> > ++ /*
> > ++ * TODO: For now, let's warn when we see an option that we are
> > ++ * going to override after setup_revisions() below. In the
> > ++ * future we might want to either die() or allow them if we
> > ++ * think they could be useful though.
> > ++ */
> > ++ for (i = 0; i < argc; i++) {
> > ++ if (!strcmp(argv[i], "--reverse") || !strcmp(argv[i], "--date-order") ||
> > ++ !strcmp(argv[i], "--topo-order") || !strcmp(argv[i], "--author-date-order") ||
> > ++ !strcmp(argv[i], "--full-history"))
> > ++ warning(_("option '%s' will be overridden"), argv[i]);
> > ++ }
> > ++
>
> [...] This seems like an inefficient way to provide this warning;Not only inefficient: think about the false positive when looking at a command-line containing `--grep --reverse`. In this instance, `--reverse` is an argument of the `--grep` option, but would be mistaken for an option in its own right.
Ciao, Johannes