git-gui: Allow git-merge to use branch names in conflict markers
[gitweb.git] / git-gui.sh
index 671b8873f27e68f8ed2c93efd6734f583f8b7500..2686c1b8f0f176bc2888d4bb75900d3475bffb01 100755 (executable)
@@ -1348,6 +1348,9 @@ unset i
 proc bind_button3 {w cmd} {
        bind $w <Any-Button-3> $cmd
        if {[is_MacOSX]} {
+               # Mac OS X sends Button-2 on right click through three-button mouse,
+               # or through trackpad right-clicking (two-finger touch + click).
+               bind $w <Any-Button-2> $cmd
                bind $w <Control-Button-1> $cmd
        }
 }
@@ -1933,6 +1936,12 @@ if {$browser ne {}} {
 }
 unset browser doc_path doc_url
 
+set root_exists 0
+bind . <Visibility> {
+       bind . <Visibility> {}
+       set root_exists 1
+}
+
 # -- Standard bindings
 #
 wm protocol . WM_DELETE_WINDOW do_quit
@@ -2407,13 +2416,15 @@ $ctxm add separator
 $ctxm add command -label {Options...} \
        -command do_options
 proc popup_diff_menu {ctxm x y X Y} {
+       global current_diff_path
        set ::cursorX $x
        set ::cursorY $y
        if {$::ui_index eq $::current_diff_side} {
                $ctxm entryconf $::ui_diff_applyhunk \
                        -state normal \
                        -label {Unstage Hunk From Commit}
-       } elseif {{_O} eq [lindex $::file_states($::current_diff_path) 0]} {
+       } elseif {![info exists file_states($current_diff_path)]
+               || {_O} eq [lindex $file_states($::current_diff_path) 0]} {
                $ctxm entryconf $::ui_diff_applyhunk \
                        -state disabled \
                        -label {Stage Hunk For Commit}