Re: [PATCH v2 3/4] builtin/diff: parse --no-index using parse_options()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 13, 2020, 21:45 UTC
- Message-ID
- <xmqqsgblmjuv.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200913083122.GA189023@generichostname>
Denton Liu <liu.denton@gmail.com> writes:
Show 9 quoted lines
>> It should be taught to be handled by >> diff.c::diff_opt_parse() instead, like all other "diff" options. I >> simply do not see what makes "--merge-base" so special compared to >> other options like "-R", "--color-words", etc. > > Unfortunately, despite the above, I don't think we'll be able to handle > this in diff_opt_parse(). --merge-base won't be common to all diff > modes. It'll only work with diff-index and diff-tree, so it'll have to > be handled in those modes specifically.
Yes, I think we can follow precedences, like the "--cached" option, "builtin/diff-index.c::cmd_diff_index()" knows about it and it is also handled by "builtin/diff.c::builtin_diff_index()".
Thanks.