Using git with diffmerge with no prompts and no alias
Asked Answered
S

1

10

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.

Spanking answered 15/10, 2012 at 18:13 Comment(0)
A
21

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
Achaean answered 16/10, 2012 at 6:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.