Re: Feature request: be able to pass arguments to difftool command
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 28, 2018, 19:37 UTC
- Message-ID
- <xmqqpny2ffjv.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180828175711.3a0aeacc@pc09.procura.nl>
"H.Merijn Brand" <h.m.brand@xs4all.nl> writes:
Show 6 quoted lines
> So, my wish would be to have an option, possibly using -- to pass > additional command line arguments to git difftool, so that > > $ git difftool $commit~1..$commit -- -m -v2 > > would pass the arguments after -- transparantly to ccdiff (in my case)
At the syntax level passing any option after "--" would be a no starter, as I would imagine that "git difftool $revs -- $paths" should still be supported.
At the concept level, however, I can see why such a feature would be useful. Perhaps
$ git difftool --backend-option=-m --backend-option=-v2 HEAD
$ git mergetool --backend-option=--foowith appropriate way(s) [*1*] to make it easier to type (and implement) would be an acceptable avenue to pursue, I wonder?
[Footnote]
*1* There are various possible ways, not all of them are mutually
incompatible.a. Give a short-form synonym, e.g. -X, to "--backend-option";
b. Assume that backend option always begins with a dash and add
one when missing, e.g. -Xm becomes --backend-option=-m c. Allow giving multiple backend options on a single option and
split at whitespace, e.g. --backend-option="-m -v2" d. Allow difftool.$toolname.opts configuration variable that is
multi-valued, so you can saygit -c difftool.ccdiff.opts=-v2 -c difftool.ccdiff.opts=-m difftool
(of course, not necessarily from the command line but the
point is you could configure it)Some of these (e.g. b, c) may not be desirable, though.