summaryrefslogtreecommitdiff
path: root/lib/mergetool.tcl
AgeCommit message (Collapse)AuthorFilesLines
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>