$LOCAL contains the contents of the file from the starting revision and $REMOTE contains the contents of the file in the ending revision. (See -extcmd in the last part of this answer) To complete my previous "diff.external" config answer above:Īs mentioned by Jakub, Git1.6.3 introduced git difftool, originally proposed in September 2008: How can I set up an editor to work with Git on Windows? for the definition of Notepad++ as an external editor.How do I setup DiffMerge with msysgit / gitk? which illustrates the concrete settings of DiffMerge and WinMerge for MsysGit and gitk.In practice (still for config file definition of external tool), you can refer to: That (the article quoted above) is the theory for external tool defined through config file (not through environment variable). More efficiently, the program could just run exit with and argument of 0.) if it run out of memory.īy piping the output of git to cat the non-zero error code is masked. Git expects the external diff program to exit with an error code only if an actual error occurred, e.g. The cat command is required, because diff(1), by default exits with an error code if the files differ. ( Diomidis Spinellis adds in the comments: You might want to try without the trailing cat if your diff tool has explicit return status) (I suppose the ' | cat' is needed only for some programs which may not return a proper or consistent return status. gitconfig and "d:/Program Files/Beyond Compare 3/BCompare.exe" "$2" "$5" | cat In my case, I have Įxternal = \"c:/Documents and Settings/sschuber/git-diff-wrapper.sh\" use forward slashed instead of backslashes. # path old-file old-hex old-mode new-file new-hex new-modeĪt the command prompt, replacing with the path to "git-diff-wrapper.sh", so your ~/.gitconfig contains ->8-(snip)-īe sure to use the correct syntax to specify the paths to the wrapper script and diff # diff is called by git with 7 parameters: The second method, which I prefer, is to configure the external diff tool via "gitġ) Create a wrapper script "git-diff-wrapper.sh" which contains something like ->8-(snip). Moreover, the executable specified by GIT_EXTERNAL_DIFF will be called with a fixed set of 7 arguments: path old-file old-hex old-mode new-file new-hex new-modeĪs most diff tools will require a different order (and only some) of the arguments, you will most likely have to specify a wrapper script instead, which in turn calls the real diff tool. However, the variable is supposed to point to the full path of the executable. The first is the method you used, by setting the GIT_EXTERNAL_DIFF variable. There are two different ways to specify an external diff tool. Since Git1.6.3, you can use the git difftool script: see my answer below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |