Merge branch 'master' of git://repo.or.cz/git-gui
* 'master' of git://repo.or.cz/git-gui: git-gui: Correct 'git gui blame' in a subdirectory git-gui: Do not offer to stage three-way diff hunks into the index git-gui: Refactor diff pane popup support for future improvements git-gui: Fix "unoptimized loading" to not cause git-gui to crash git-gui: Paper bag fix "Stage Hunk For Commit" in diff context menu git-gui: Allow git-merge to use branch names in conflict markers git-gui: Fix window manager problems on ion3
This commit is contained in:
commit
e92ea62425
@ -60,54 +60,6 @@ if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
######################################################################
|
|
||||||
##
|
|
||||||
## configure our library
|
|
||||||
|
|
||||||
set oguilib {@@GITGUI_LIBDIR@@}
|
|
||||||
set oguirel {@@GITGUI_RELATIVE@@}
|
|
||||||
if {$oguirel eq {1}} {
|
|
||||||
set oguilib [file dirname [file dirname [file normalize $argv0]]]
|
|
||||||
set oguilib [file join $oguilib share git-gui lib]
|
|
||||||
} elseif {[string match @@* $oguirel]} {
|
|
||||||
set oguilib [file join [file dirname [file normalize $argv0]] lib]
|
|
||||||
}
|
|
||||||
|
|
||||||
set idx [file join $oguilib tclIndex]
|
|
||||||
if {[catch {set fd [open $idx r]} err]} {
|
|
||||||
catch {wm withdraw .}
|
|
||||||
tk_messageBox \
|
|
||||||
-icon error \
|
|
||||||
-type ok \
|
|
||||||
-title "git-gui: fatal error" \
|
|
||||||
-message $err
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
if {[gets $fd] eq {# Autogenerated by git-gui Makefile}} {
|
|
||||||
set idx [list]
|
|
||||||
while {[gets $fd n] >= 0} {
|
|
||||||
if {$n ne {} && ![string match #* $n]} {
|
|
||||||
lappend idx $n
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
set idx {}
|
|
||||||
}
|
|
||||||
close $fd
|
|
||||||
|
|
||||||
if {$idx ne {}} {
|
|
||||||
set loaded [list]
|
|
||||||
foreach p $idx {
|
|
||||||
if {[lsearch -exact $loaded $p] >= 0} continue
|
|
||||||
source [file join $oguilib $p]
|
|
||||||
lappend loaded $p
|
|
||||||
}
|
|
||||||
unset loaded p
|
|
||||||
} else {
|
|
||||||
set auto_path [concat [list $oguilib] $auto_path]
|
|
||||||
}
|
|
||||||
unset -nocomplain oguirel idx fd
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
##
|
##
|
||||||
## read only globals
|
## read only globals
|
||||||
@ -532,7 +484,11 @@ if {$_git eq {}} {
|
|||||||
|
|
||||||
if {[catch {set _git_version [git --version]} err]} {
|
if {[catch {set _git_version [git --version]} err]} {
|
||||||
catch {wm withdraw .}
|
catch {wm withdraw .}
|
||||||
error_popup "Cannot determine Git version:
|
tk_messageBox \
|
||||||
|
-icon error \
|
||||||
|
-type ok \
|
||||||
|
-title "git-gui: fatal error" \
|
||||||
|
-message "Cannot determine Git version:
|
||||||
|
|
||||||
$err
|
$err
|
||||||
|
|
||||||
@ -541,7 +497,11 @@ $err
|
|||||||
}
|
}
|
||||||
if {![regsub {^git version } $_git_version {} _git_version]} {
|
if {![regsub {^git version } $_git_version {} _git_version]} {
|
||||||
catch {wm withdraw .}
|
catch {wm withdraw .}
|
||||||
error_popup "Cannot parse Git version string:\n\n$_git_version"
|
tk_messageBox \
|
||||||
|
-icon error \
|
||||||
|
-type ok \
|
||||||
|
-title "git-gui: fatal error" \
|
||||||
|
-message "Cannot parse Git version string:\n\n$_git_version"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -619,7 +579,11 @@ proc git-version {args} {
|
|||||||
|
|
||||||
if {[git-version < 1.5]} {
|
if {[git-version < 1.5]} {
|
||||||
catch {wm withdraw .}
|
catch {wm withdraw .}
|
||||||
error_popup "[appname] requires Git 1.5.0 or later.
|
tk_messageBox \
|
||||||
|
-icon error \
|
||||||
|
-type ok \
|
||||||
|
-title "git-gui: fatal error" \
|
||||||
|
-message "[appname] requires Git 1.5.0 or later.
|
||||||
|
|
||||||
You are using [git-version]:
|
You are using [git-version]:
|
||||||
|
|
||||||
@ -627,6 +591,54 @@ You are using [git-version]:
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
##
|
||||||
|
## configure our library
|
||||||
|
|
||||||
|
set oguilib {@@GITGUI_LIBDIR@@}
|
||||||
|
set oguirel {@@GITGUI_RELATIVE@@}
|
||||||
|
if {$oguirel eq {1}} {
|
||||||
|
set oguilib [file dirname [file dirname [file normalize $argv0]]]
|
||||||
|
set oguilib [file join $oguilib share git-gui lib]
|
||||||
|
} elseif {[string match @@* $oguirel]} {
|
||||||
|
set oguilib [file join [file dirname [file normalize $argv0]] lib]
|
||||||
|
}
|
||||||
|
|
||||||
|
set idx [file join $oguilib tclIndex]
|
||||||
|
if {[catch {set fd [open $idx r]} err]} {
|
||||||
|
catch {wm withdraw .}
|
||||||
|
tk_messageBox \
|
||||||
|
-icon error \
|
||||||
|
-type ok \
|
||||||
|
-title "git-gui: fatal error" \
|
||||||
|
-message $err
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
if {[gets $fd] eq {# Autogenerated by git-gui Makefile}} {
|
||||||
|
set idx [list]
|
||||||
|
while {[gets $fd n] >= 0} {
|
||||||
|
if {$n ne {} && ![string match #* $n]} {
|
||||||
|
lappend idx $n
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
set idx {}
|
||||||
|
}
|
||||||
|
close $fd
|
||||||
|
|
||||||
|
if {$idx ne {}} {
|
||||||
|
set loaded [list]
|
||||||
|
foreach p $idx {
|
||||||
|
if {[lsearch -exact $loaded $p] >= 0} continue
|
||||||
|
source [file join $oguilib $p]
|
||||||
|
lappend loaded $p
|
||||||
|
}
|
||||||
|
unset loaded p
|
||||||
|
} else {
|
||||||
|
set auto_path [concat [list $oguilib] $auto_path]
|
||||||
|
}
|
||||||
|
unset -nocomplain oguirel idx fd
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
##
|
##
|
||||||
## feature option selection
|
## feature option selection
|
||||||
@ -691,7 +703,15 @@ if {![file isdirectory $_gitdir]} {
|
|||||||
error_popup "Git directory not found:\n\n$_gitdir"
|
error_popup "Git directory not found:\n\n$_gitdir"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
if {![is_enabled bare]} {
|
if {$_prefix ne {}} {
|
||||||
|
regsub -all {[^/]+/} $_prefix ../ cdup
|
||||||
|
if {[catch {cd $cdup} err]} {
|
||||||
|
catch {wm withdraw .}
|
||||||
|
error_popup "Cannot move to top of working directory:\n\n$err"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
unset cdup
|
||||||
|
} elseif {![is_enabled bare]} {
|
||||||
if {[lindex [file split $_gitdir] end] ne {.git}} {
|
if {[lindex [file split $_gitdir] end] ne {.git}} {
|
||||||
catch {wm withdraw .}
|
catch {wm withdraw .}
|
||||||
error_popup "Cannot use funny .git directory:\n\n$_gitdir"
|
error_popup "Cannot use funny .git directory:\n\n$_gitdir"
|
||||||
@ -726,6 +746,7 @@ set empty_tree {}
|
|||||||
set current_branch {}
|
set current_branch {}
|
||||||
set is_detached 0
|
set is_detached 0
|
||||||
set current_diff_path {}
|
set current_diff_path {}
|
||||||
|
set is_3way_diff 0
|
||||||
set selected_commit_type new
|
set selected_commit_type new
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
@ -1936,6 +1957,12 @@ if {$browser ne {}} {
|
|||||||
}
|
}
|
||||||
unset browser doc_path doc_url
|
unset browser doc_path doc_url
|
||||||
|
|
||||||
|
set root_exists 0
|
||||||
|
bind . <Visibility> {
|
||||||
|
bind . <Visibility> {}
|
||||||
|
set root_exists 1
|
||||||
|
}
|
||||||
|
|
||||||
# -- Standard bindings
|
# -- Standard bindings
|
||||||
#
|
#
|
||||||
wm protocol . WM_DELETE_WINDOW do_quit
|
wm protocol . WM_DELETE_WINDOW do_quit
|
||||||
@ -2410,23 +2437,26 @@ $ctxm add separator
|
|||||||
$ctxm add command -label {Options...} \
|
$ctxm add command -label {Options...} \
|
||||||
-command do_options
|
-command do_options
|
||||||
proc popup_diff_menu {ctxm x y X Y} {
|
proc popup_diff_menu {ctxm x y X Y} {
|
||||||
global current_diff_path
|
global current_diff_path file_states
|
||||||
set ::cursorX $x
|
set ::cursorX $x
|
||||||
set ::cursorY $y
|
set ::cursorY $y
|
||||||
if {$::ui_index eq $::current_diff_side} {
|
if {$::ui_index eq $::current_diff_side} {
|
||||||
$ctxm entryconf $::ui_diff_applyhunk \
|
set s normal
|
||||||
-state normal \
|
set l "Unstage Hunk From Commit"
|
||||||
-label {Unstage Hunk From Commit}
|
|
||||||
} 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}
|
|
||||||
} else {
|
} else {
|
||||||
$ctxm entryconf $::ui_diff_applyhunk \
|
if {$current_diff_path eq {}
|
||||||
-state normal \
|
|| ![info exists file_states($current_diff_path)]
|
||||||
-label {Stage Hunk For Commit}
|
|| {_O} eq [lindex $file_states($current_diff_path) 0]} {
|
||||||
|
set s disabled
|
||||||
|
} else {
|
||||||
|
set s normal
|
||||||
}
|
}
|
||||||
|
set l "Stage Hunk For Commit"
|
||||||
|
}
|
||||||
|
if {$::is_3way_diff} {
|
||||||
|
set s disabled
|
||||||
|
}
|
||||||
|
$ctxm entryconf $::ui_diff_applyhunk -state $s -label $l
|
||||||
tk_popup $ctxm $X $Y
|
tk_popup $ctxm $X $Y
|
||||||
}
|
}
|
||||||
bind_button3 $ui_diff [list popup_diff_menu $ctxm %x %y %X %Y]
|
bind_button3 $ui_diff [list popup_diff_menu $ctxm %x %y %X %Y]
|
||||||
|
@ -148,11 +148,12 @@ proc make_toplevel {t w args} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if {[winfo ismapped .]} {
|
if {$::root_exists || [winfo ismapped .]} {
|
||||||
regsub -all {::} $this {__} w
|
regsub -all {::} $this {__} w
|
||||||
set top .$w
|
set top .$w
|
||||||
set pfx $top
|
set pfx $top
|
||||||
toplevel $top
|
toplevel $top
|
||||||
|
set ::root_exists 1
|
||||||
} else {
|
} else {
|
||||||
set top .
|
set top .
|
||||||
set pfx {}
|
set pfx {}
|
||||||
|
@ -114,7 +114,7 @@ method _start {} {
|
|||||||
lappend cmd --strategy=recursive
|
lappend cmd --strategy=recursive
|
||||||
lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
|
lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]]
|
||||||
lappend cmd HEAD
|
lappend cmd HEAD
|
||||||
lappend cmd $cmit
|
lappend cmd $name
|
||||||
|
|
||||||
set msg "Merging $current_branch and $stitle"
|
set msg "Merging $current_branch and $stitle"
|
||||||
ui_status "$msg..."
|
ui_status "$msg..."
|
||||||
|
Loading…
Reference in New Issue
Block a user