On Wed, Mar 20, 2019 at 12:06 PM Jeff King <peff@xxxxxxxx> wrote: > > On Tue, Mar 19, 2019 at 11:18:26PM +0000, Thomas Gummerer wrote: > > > From a quick search I couldn't find where 'git diff' actually parses > > the '-v' argument, but I wonder if we should actually disallow it, in > > case we want to use it for something else in the future? It's not > > documented anywhere in the docs either. > > It's a bit interesting, actually. git-diff uses setup_revisions() to > parse its arguments, which picks up any diff options, as well as parsing > the revs and pathspecs. > > ... > > - we may want to teach the "diff" porcelain not to accept useless > revision options. I suspect it may be a bit tricky, just because of > the way the code takes advantage of setup_revisions. This is actually in my TODO list. Once the parseopt conversion for revision.c and diff.c is done, "git diff --help" would be _very_ long because of this exact problem. But then once the conversion is over, I think removing unused options is quite simple (by manipulating 'struct option[]' array before calling parse_options). -- Duy