git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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=--foo

with 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 say
	git -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.
Previous: H.Merijn BrandNext: H.Merijn Brand
Message 2 of 5 in “Feature request: be able to pass arguments to difftool command”
  1. H.Merijn BrandAug 28, 2018
  2. Junio C HamanoAug 28, 2018
  3. H.Merijn BrandAug 29, 2018
  4. David AguilarSep 16, 2018
  5. Junio C HamanoSep 17, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.