![]() Now, regarding the "Unexpected parameter" part: Is there a way to see what are the parameters getting passed when I call git diff ?ġ/ There actually is a way to see what are the parameters getting passed!Īdd the following line in the C:\Program Files\Git\libexec\git-core\git-sh-setup file: git_editor() " will see what editor is being called, with what parameter. ![]() Unexpected parameter 'C:/Docume~/avggeek/LOCALS~1/Temp/.diff_b08444 (with the ' -e' option, I have just ot type on ' ESC' to close and quit the diff tool: that works great!)Īdded the ' /bin/sh' header and tried running git diff again. "C:/Program Files/WinMerge/WinMergeU.exe" -e -ub "$2" "$5" | cat I did not test it with DiffMerge, but with WinMerge, it works just fine, both from a DOS session or a Git Shell. "C:/Programs/SourceGear/DiffMerge/DiffMerge.exe" /title1="Old Version" "$2" /title2="New Version" "$5" | catĭo not worry about making all the ' \' go ' /': it is done by the Git scripts calling the external diff tool. # path old-file old-hex old-mode new-file new-hex new-mode # diff is called by git with 7 parameters: So try to put in your ".bat" (even though it is not exactly a bat script, the extension is not important here): #!/bin/sh The key was to realize the wrapper was not a DOS script, but a /bin/sh script. I just experienced a somewhat similar experience with setting Notepad as my external editor with msysgit1.6.2.2. For more recent versions of DiffMerge (3.3.1), the command path needs to be changed: cmd = "C:/PROGRA~1/SourceGear/Common/DiffMerge/sgdm.exe. This simple solution works perfectly for me, too. You can also set it up using the commands git config -replace -global if you so wish. Note that I used the old DOS 8.3 format in the path Ĭmd = "H:/PROGRA~1/SourceGear/DiffMerge/DiffMerge.exe $LOCAL $REMOTE"Ĭmd = "H:/PROGRA~1/SourceGear/DiffMerge/DiffMerge.exe -merge -result=$MERGED $LOCAL $BASE $REMOTE" You'll just need to edit the path to where your version of of DiffMerge is. gitconfig which normally resides in the following directory C:\Documents and Settings\ You'll need to have DiffMerge program installed already. It does not require any scripts only that you edit your. So what I did eventually was to hack together my own simple solution from all the info I got on the internet which works for me. I could get the merge part to work and not the diff part or vice versa. I tried all of the solutions above and elsewhere. I looked all over the internet for the answer to this. Trying the "external diff" option for a particular file gives the cryptic error message Unknown Option "Ĭlearly, I have no idea what I'm doing anymore so any help would be much appreciated. Pressing on, I launched gitk and under Edit>Preferences, I chose the same wrapper script. ![]() I get a message File (\dev\null) not found - which given I'm on Windows is not surprising. gitconfig file as follows: Įxternal = C:/Programs/git/cmd/git-diff-wrapper.bat I placed the bat file under %GIT_INSTALL%/cmd and edited my. "C:/Programs/SourceGear/DiffMerge/DiffMerge.exe" /title1="Old Version" %oldW% /title2="New Version" %newW% REM - Switch forward slashes to back slashes. Based on this thread on SO, I created the following batch file: off I'm trying to put together a wrapper script that I can use to replace the built in git diff with DiffMerge.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |