summaryrefslogtreecommitdiff
path: root/lib/mergetool.tcl
AgeCommit message (Collapse)AuthorFilesLines
2020-04-22Subject: git-gui: fix syntax error because of missing semicolonLibravatar Ansgar Röber1-1/+1
For some asynchronous operations, we build a chain of callbacks to execute when the operation is done. These callbacks are held in $after, and a new callback can be added by appending to $after. Once the operation is done, $after is executed as a script. But if we don't append a semi-colon after the procedure calls, they will appear to Tcl as arguments to the previous procedure's arguments. So, for example, if $after is "foo", and we just append "bar", then $after becomes "foo bar", and bar will be treated as an argument to foo. If foo does not accept any optional arguments, it would result in Tcl throwing an error. If instead we do append a semi-colon, $after will look like "foo;bar;", and these will be treated as two separate procedure calls. Before d9c6469 (git-gui: update status bar to track operations, 2019-12-01), this problem was masked because ui_ready/ui_status did accept an optional argument. In d9c6469, ui_ready stopped accepting an optional argument, and this error started showing up. Another instance of this problem is when a call to ui_status without a trailing semicolon. ui_status never accepted an optional argument to begin with, but the issue never managed to surface. So, fix these errors by making sure we always append a semi-colon after procedure calls when multiple callbacks are involved in $after. Helped-by: Pratyush Yadav <me@yadavpratyush.com> Signed-off-by: Ansgar Röber <ansgar.roeber@rwth-aachen.de>
2013-02-22git-gui: fix the mergetool launcher for the Beyond Compare tool.Libravatar Pat Thoyts1-2/+2
When using Beyond Compare as the mergetool it fails to save the merged result correctly due to a quoting problem when executing the tool. This patch solves the quoting problem. Signed-off-by: Warren Falk <warren@warrenfalk.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-02-27mergetool--lib: Add Beyond Compare 3 as a toolLibravatar Sebastian Schuberth1-0/+7
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-27mergetool--lib: Sort tools alphabetically for easier lookupLibravatar Sebastian Schuberth1-47/+47
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-08git-gui: Ensure consistent usage of mergetool.keepBackupLibravatar Ferry Huberts1-1/+1
In several places merge.keepBackup is used i.s.o. mergetool.keepBackup. This patch makes it all consistent. Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-03-20git-gui: Fix merge conflict display error when filename contains spacesLibravatar Jens Lehmann1-1/+1
When a merge conflict occurs in a file with spaces in the filename, git-gui showed wrongly "LOCAL: deleted". Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30git-gui: Make Ctrl-T safe to use for conflicting files.Libravatar Alexander Gavrilov1-3/+4
A previous patch added a check for conflict markers, which is done when the file is about to be staged due to a click on the icon. However, pressing Ctrl-T still immediately stages the file without confirmation. This patch fixes it. The check requires a loaded diff, so staging multiple files at once won't work if they are unmerged. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30git-gui: Do not automatically stage file after merge tool finishesLibravatar Johannes Sixt1-9/+1
If a merge tool was invoked on a conflicted file and the tool completed, then the conflicted file was staged automatically. However, the fact that the user closed the merge tool cannot be understood as the unequivocal sign that the conflict was completely resolved. For example, the user could have decided to postpone the resolution of the conflict, or could have accidentally closed the tool. We better leave the file unstaged and let the user stage it explicitly. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-24git-gui: Reenable staging unmerged files by clicking the icon.Libravatar Alexander Gavrilov1-6/+27
This restores functionality of the file icon for unmerged files. Safety is enforced by loading the diff and checking for lines that look like conflict markers. If such lines are found, or the conflict involves deletion and/or symlinks, a confirmation dialog is presented. Otherwise, the icon immediately stages the working copy version of the file. Includes a revert of 2fe5b2ee42897a3acc78e5ddaace3775eb2713ca (Restore ability to Stage Working Copy for conflicts) Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Tested-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-12git-gui: I18n fix sentence parts into full sentences for translation again.Libravatar Christian Stimming1-6/+6
For translations, it is almost always impossible to correctly translate parts of sentences in almost any other language. Hence, messages like this must be re-organized into full sentences. Signed-off-by: Christian Stimming <stimming@tuhh.de> Signed-off-by: Shawn O. Pearce <sop@google.com>
2008-09-12git-gui: Restore ability to Stage Working Copy for conflicts.Libravatar Alexander Gavrilov1-0/+6
Tools like rerere leave files marked as conflicts in the index, while actually resolving them in the working copy. Also, some people like to use an external editor to resolve conflicts. This patch restores functionality previously removed in commit 617ceee653 by adding a new context menu item. It still ensures that the user does not stage conflicting files accidentally by clicking on the icon instead of the name. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Tested-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <sop@google.com>
2008-09-04git-gui: Reimplement and enhance auto-selection of diffs.Libravatar Alexander Gavrilov1-6/+2
Generalize the next_diff system, and implement auto-reselection for merge tool resolution and reshow_diff. Also add auto-selection of diffs after rescan, if no diff is already selected. New auto-select rules: - Rescan auto-selects the first conflicting file, or if none a modified tracked file, if nothing was selected previously. - Resolving a conflict auto-selects the nearest conflicting file, or nothing if everything is resolved. - Staging the last remaining hunk auto-selects the nearest modified staged file. - Staging a file through its icon auto-selects the nearest file. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-04git-gui: Support more merge tools.Libravatar Alexander Gavrilov1-0/+27
Add native support for Araxis Merge, WinMerge and Perforce merge. Custom merge tools are not implemented by mergetool.tcl; besides, native support allows constructing the command lines in a more intelligent way. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-04git-gui: Support calling merge tools.Libravatar Alexander Gavrilov1-0/+252
Adds an item to the diff context menu in conflict mode, which invokes a merge tool for the selected file. Tool command-line handling code was ported from git-mergetool. Automatic default tool selection and custom merge tools are not supported. If merge.tool is not set, git-gui defaults to meld. This implementation uses a checkout-index hack in order to retrieve all stages with autocrlf and filters properly applied. It requires temporarily moving the original conflict file out of the way. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-04git-gui: Support resolving conflicts via the diff context menu.Libravatar Alexander Gavrilov1-0/+98
If the file has merge conflicts, show a special version of the diff context menu, which includes conflict resolution commands instead of Stage Hunk/Line. This patch only supports resolving by discarding all sides except one. Discarding is the only way to resolve conflicts involving symlinks and/or deletion, excluding manual editing. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>