Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using git with diffmerge with no prompts and no alias

On OSX, I'm using diffmerge as my git diffing tool. Here is my .gitconfig:

[diff]
        tool = diffmerge
[difftool "diffmerge"]
        cmd = diffmerge \"$LOCAL\" \"$REMOTE\"
[alias]
        d = difftool --no-prompt

If I just use git difftool it will prompt me for every single file I want to diff. To get around this, I created the git d alias and added the --no-prompt flag.

Is there any way I can prevent the repeated prompts without having the alias? I tried inserting prompt=false and prompt = NO under difftool, as well as moving the --no-prompt flag next to the diffmerge command, but none of these helped.

like image 929
Newtang Avatar asked Oct 15 '12 18:10

Newtang


1 Answers

moving the --no-prompt flag next to the diffmerge command

--no-prompt is an argument of difftool (as I mention in "How do I view 'git diff' output with a visual diff program?").
So I confirm it won't work with diffmerge.

I tried inserting prompt=false and prompt = NO under difftool

under a [difftool] section directly, that should work (not under [difftool "diffmerge"])

You can see another approach here, based on wrappers: that can help to debug those commands.

git config --global difftool.diffmerge.cmd "diffmerge-diff.sh \"\$LOCAL\" \"\$REMOTE\"" \"\$BASE\"" \"\$MERGED\""
git config --global difftool.prompt false
git config --global diff.tool diffmerge
git difftool
like image 194
VonC Avatar answered Oct 18 '22 04:10

VonC