Skip to content

Commit

Permalink
git-gui: Restore ability to Stage Working Copy for conflicts.
Browse files Browse the repository at this point in the history
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 617ceee 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>
  • Loading branch information
Alexander Gavrilov authored and Shawn O. Pearce committed Sep 12, 2008
1 parent a9786bb commit 2fe5b2e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2902,6 +2902,11 @@ $ctxmmg add command \
-command {merge_resolve_one 1}
lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state]
$ctxmmg add separator
$ctxmmg add command \
-label [mc "Stage Working Copy"] \
-command {merge_resolve_one 0}
lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state]
$ctxmmg add separator
create_common_diff_popup $ctxmmg
proc popup_diff_menu {ctxm ctxmmg x y X Y} {
Expand Down
6 changes: 6 additions & 0 deletions lib/mergetool.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ proc merge_resolve_one {stage} {
global current_diff_path

switch -- $stage {
0 { # Stage without confirmation, to minimize
# disruption of the rerere workflow
merge_add_resolution $current_diff_path
return
}

1 { set target [mc "the base version"] }
2 { set target [mc "this branch"] }
3 { set target [mc "the other branch"] }
Expand Down

0 comments on commit 2fe5b2e

Please sign in to comment.