aboutsummaryrefslogtreecommitdiff
path: root/git-mergetool--lib.sh
Commit message (Collapse)AuthorAge
* Pass empty file to p4merge where no base is suitable.Ciaran Jessup2011-05-01
| | | | | | | | | | | | | | | | | | | | | Modify the p4merge client command to pass a reference to an empty file instead of the local file when no base revision available. In the situation where a merge tries to add a file from one branch into a branch that already contains that file (by name), p4merge currently seems to have successfully automatically resolved the 'conflict' when it is opened (correctly if the files differed by just whitespace for example) but leaves the save button disabled. This means the user of the p4merge client cannot commit the resolved changes back to disk and merely exits, leaving the original (merge-conflicted) file intact on the disk. Provide an empty base file to p4merge so that it leaves the save button enabled. This will allow saving of the auto-resolution to disk. Signed-off-by: Ciaran Jessup <ciaranj@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'ss/mergetool--lib'Junio C Hamano2011-03-19
|\ | | | | | | | | | | * ss/mergetool--lib: mergetool--lib: Add Beyond Compare 3 as a tool mergetool--lib: Sort tools alphabetically for easier lookup
| * mergetool--lib: Add Beyond Compare 3 as a toolSebastian Schuberth2011-02-28
| | | | | | | | | | | | Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * mergetool--lib: Sort tools alphabetically for easier lookupSebastian Schuberth2011-02-28
| | | | | | | | | | | | Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | mergetool-lib: call vim in readonly mode for diffsMichael J Gruber2011-02-25
|/ | | | | | | | | | | | | When [g]vimdiff is called for files which are opened already, the editor complains about the existing swap file. But we do not want to write anything when called from difftool. So, make difftool use "-R" for the vim family. This - prevents the use of a swap file and - marks the buffers readonly. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* mergetool-lib: make the three-way diff the default for vim/gvimDan McGee2010-09-29
| | | | | | | | The original vimdiff/gvimdiff configuration is now available by using 'vimdiff2' or 'gvimdiff2' as the preferred merge tool. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* mergetool-lib: add a three-way diff view for vim/gvimDan McGee2010-09-15
| | | | | | | | | | | When the base version is available, use a three-way, four panel view by default. This shows the (local, base, remote) revisions up top and the merged result by itself in the lower pane. All revisions will still scroll together by default, and the cursor still defaults to the merged result edit pane. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* mergetool-lib: combine vimdiff and gvimdiff run blocksDan McGee2010-09-15
| | | | | | | | | They are nearly identical outside of the foreground flag, which can safely be passed to both vim and gvim. The merge tool itself is named in $merge_tool_path. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* mergetool: Remove explicit references to /dev/ttyCharles Bailey2010-08-20
| | | | | | | | | | | | | | | mergetool used /dev/tty to switch back to receiving input from the user via inside a block with a redirected stdin. This harms testability, so change mergetool to save its original stdin to an alternative fd in this block and restore it for those sub-commands that need the original stdin. Includes additional compatibility fix from Jonathan Nieder. Tested-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Charles Bailey <charles@hashpling.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* add shebang line to git-mergetool--lib.shJeff King2010-01-29
| | | | | | | | | | | | | | | | Even though this script is expected to be sourced instead of executed on its own, the #!/bin/sh line provides simple documentation about what format the file is in. In particular, the lack of such a line was confusing the valgrind support of our test scripts, which assumed that any executable without a #!-line should be intercepted and run through valgrind. So during valgrind-enabled tests, any script sourcing this file actually sourced the valgrind interception script instead. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'rs/work-around-grep-opt-insanity'Junio C Hamano2009-11-25
|\ | | | | | | | | | | | | | | | | * rs/work-around-grep-opt-insanity: Protect scripted Porcelains from GREP_OPTIONS insanity mergetool--lib: simplify guess_merge_tool() Conflicts: git-instaweb.sh
| * mergetool--lib: simplify guess_merge_tool()René Scharfe2009-11-23
| | | | | | | | | | | | | | | | | | Use a case statement instead of calling grep to find out if the editor's name contains the string "vim". Remove the check for emacs, as this branch did the same as the default one anyway. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | mergetool--lib: add p4merge as a pre-configured mergetool optionScott Chacon2009-10-28
|/ | | | | | | | Add p4merge to the set of built-in diff/merge tools, and update bash completion and documentation. Signed-off-by: Scott Chacon <schacon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* mergetool--lib: add support for araxis mergeDavid Aguilar2009-05-24
| | | | | | | | | Araxis merge is now a built-in diff/merge tool. This adds araxis to git-completion and updates the documentation to mention araxis. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* mergetool--lib: specialize diff options for emerge and ecmergeDavid Aguilar2009-05-09
| | | | | | | | | | | | | The ecmerge documentation mentions the following form: ecmerge --mode=diff2 $1 $2 Since git-difftool is about diffing, we should use that instead of --mode=merge2. Likewise, this drops the $MERGED argument to emerge, as discussed on the git list ($gmane/117930). Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* mergetool--lib: simplify API usage by removing more global variablesDavid Aguilar2009-04-12
| | | | | | | | | | | | | The mergetool--lib scriplet was tricky to use because it relied upon the existance of several global shell variables. This removes more global variables so that things are simpler for callers. A side effect is that some variables are recomputed each time run_merge_tool() is called, but the overhead for recomputing them is justified by the simpler implementation. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* difftool/mergetool: refactor commands to use git-mergetool--libDavid Aguilar2009-04-08
This consolidates the common functionality from git-mergetool and git-difftool--helper into a single git-mergetool--lib scriptlet. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>