Re: [PATCH 3/4] diff-no-index: Remove unused variable.
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jul 14, 2013, 22:07 UTC
- Message-ID
- <20130714220739.GC13444@google.com>
- In-Reply-To
- <1373837749-14402-3-git-send-email-stefanbeller@googlemail.com>
Stefan Beller wrote:
> [Subject: diff-no-index: Remove unused variable.]
[...]
> --- a/diff-no-index.c > +++ b/diff-no-index.c
[...]
Show 5 quoted lines
> - else if (!strcmp(argv[i], "-q")) {
> + else if (!strcmp(argv[i], "-q"))
> - options |= DIFF_SILENT_ON_REMOVED;
> i++;
> - }This feature was obviously never tested with --no-index, so I agree it makes sense to remove it. Probably the commit message and a comment should say so, though. E.g.:
diff --no-index: remove nonfunctional "-q" handling
Before v1.5.6-rc1~41^2~2, the option parsing for diff --no-index and "git diff-files" shared code. In "git diff-files", "-q" means to be silent about removed files. In "git diff --no-index", in various versions it has been an error, an infinite loop, or a no-op.
Simplify the code to clarify that it is now a no-op, continuing to accept and ignore the -q option in "git diff --no-index" to avoid breaking scripts.
I wouldn't mind removing support for "-q" altogether, by the way (as a separate change).
Hope that helps, Jonathan