git diff - Configuring multiple git mergetool and difftool so that appropriate tool will be chosen based on extension -


When I difftool git, then it runs the default difftool for all files I select the appropriate difftool based on expansion Wrote a script for and I call in the script like git difftool -t mytool. Difftool redirects all the logic to all columns, which is good though, it redirects all file names in any way as well. So basically, my script gets useless because the custom futulto is replaced with all the files that change.

What do I have to do, limit difftool to a file, or call my install with at least one file, not the rest. Actually, this is my script and I have the default difftool as in .gitconfig.

  if_sbs $ 1 $ 2; So #custom difftool which is also defined in the text after .gitconfig Git DT T tune the rest #for all files Git DT tax kdiff3 Fi  

Apparently, git naturally pipe all file information and it is not shown in logic for the script. Instead of defining other diff tools in .gitconfig as "difftool", I have called the executable file with the proper arguments. The complete solution is the following:

.gitconfig

  [difftool] expedited = false [mergetool] prompt = false [difftool "selectiveDiff"] cmd = difftool.sh $ local $ REMOTE $ base $ merger keepBackup = false [mergetool "selectiveMerge"] cmd = mergetool.sh $ local $ REMOTE $ base $ merger keepBackup = false  

Please note Keep that script should be in PATH. Either make a directory and add it to your path or use one that is already in PATH

Define the variable in anywhere

  RHAPSODY_PATH = "C: / program files (x86) /IBM/Rational/Rhapsody/8.0.5/DiffMerge.exe "KDIFF3_PATH =" C: / program files / KDiff3 / kdiff3.exe " 

Difftool.sh

  if_sbs $ 1 $ 2; So "$ RHAPSODY_PATH" -Base $ 3 $ 1 $ 2 -xcompare else "$ KDIFF3_PATH" $ 1 $ 2 fi  

mergetool.sh

  if_sbs $ 1 $ 2; So -base based file1 file2 out output -xmerge "$ RHAPSODY_PATH" # DiffMerge.exe $ 3 $ 1 $ 2 out of $ 4 -base -xmerge rest # kdiff3 based file1 file2 -o output "$ KDIFF3_PATH" $ 3 $ 1 $ 2 -o $ 4 fi  

This will select the right frame and merge tool on the call.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -