Compare commits
8 Commits
gitgui-0.7
...
gitgui-0.7
Author | SHA1 | Date | |
---|---|---|---|
7e508eb1a2 | |||
fffaaba358 | |||
4e817d1ac4 | |||
fb626dc000 | |||
82a2d6bdf9 | |||
39fa2a983d | |||
b2f3bb1b66 | |||
615b865358 |
@ -78,5 +78,3 @@ test "$VN" = "$VC" || {
|
|||||||
echo >&2 "GITGUI_VERSION = $VN"
|
echo >&2 "GITGUI_VERSION = $VN"
|
||||||
echo "GITGUI_VERSION = $VN" >$GVF
|
echo "GITGUI_VERSION = $VN" >$GVF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
8
Makefile
8
Makefile
@ -7,6 +7,8 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
|
|||||||
@$(SHELL_PATH) ./GIT-VERSION-GEN
|
@$(SHELL_PATH) ./GIT-VERSION-GEN
|
||||||
-include GIT-VERSION-FILE
|
-include GIT-VERSION-FILE
|
||||||
|
|
||||||
|
uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
|
||||||
|
|
||||||
SCRIPT_SH = git-gui.sh
|
SCRIPT_SH = git-gui.sh
|
||||||
GITGUI_BUILT_INS = git-citool
|
GITGUI_BUILT_INS = git-citool
|
||||||
ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
|
ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
|
||||||
@ -58,8 +60,12 @@ exedir_SQ = $(subst ','\'',$(exedir))
|
|||||||
|
|
||||||
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
|
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
|
||||||
$(QUIET_GEN)rm -f $@ $@+ && \
|
$(QUIET_GEN)rm -f $@ $@+ && \
|
||||||
|
GITGUI_RELATIVE= && \
|
||||||
if test '$(exedir_SQ)' = '$(libdir_SQ)'; then \
|
if test '$(exedir_SQ)' = '$(libdir_SQ)'; then \
|
||||||
GITGUI_RELATIVE=1; \
|
if test "$(uname_O)" = Cygwin; \
|
||||||
|
then GITGUI_RELATIVE= ; \
|
||||||
|
else GITGUI_RELATIVE=1; \
|
||||||
|
fi; \
|
||||||
fi && \
|
fi && \
|
||||||
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
||||||
-e 's|^ exec wish "$$0"| exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
|
-e 's|^ exec wish "$$0"| exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
|
||||||
|
19
git-gui.sh
19
git-gui.sh
@ -1,5 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Tcl ignores the next line -*- tcl -*- \
|
# Tcl ignores the next line -*- tcl -*- \
|
||||||
|
if test "z$*" = zversion \
|
||||||
|
|| test "z$*" = z--version; \
|
||||||
|
then \
|
||||||
|
echo 'git-gui version @@GITGUI_VERSION@@'; \
|
||||||
|
exit; \
|
||||||
|
fi; \
|
||||||
exec wish "$0" -- "$@"
|
exec wish "$0" -- "$@"
|
||||||
|
|
||||||
set appvers {@@GITGUI_VERSION@@}
|
set appvers {@@GITGUI_VERSION@@}
|
||||||
@ -271,11 +277,6 @@ proc tk_optionMenu {w varName args} {
|
|||||||
##
|
##
|
||||||
## version check
|
## version check
|
||||||
|
|
||||||
if {{--version} eq $argv || {version} eq $argv} {
|
|
||||||
puts "git-gui version $appvers"
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
set req_maj 1
|
set req_maj 1
|
||||||
set req_min 5
|
set req_min 5
|
||||||
|
|
||||||
@ -471,7 +472,8 @@ proc rescan {after {honor_trustmtime 1}} {
|
|||||||
|
|
||||||
if {![$ui_comm edit modified]
|
if {![$ui_comm edit modified]
|
||||||
|| [string trim [$ui_comm get 0.0 end]] eq {}} {
|
|| [string trim [$ui_comm get 0.0 end]] eq {}} {
|
||||||
if {[load_message GITGUI_MSG]} {
|
if {[string match amend* $commit_type]} {
|
||||||
|
} elseif {[load_message GITGUI_MSG]} {
|
||||||
} elseif {[load_message MERGE_MSG]} {
|
} elseif {[load_message MERGE_MSG]} {
|
||||||
} elseif {[load_message SQUASH_MSG]} {
|
} elseif {[load_message SQUASH_MSG]} {
|
||||||
}
|
}
|
||||||
@ -1543,8 +1545,7 @@ if {[is_MacOSX]} {
|
|||||||
|
|
||||||
# -- Tools Menu
|
# -- Tools Menu
|
||||||
#
|
#
|
||||||
if {[file exists /usr/local/miga/lib/gui-miga]
|
if {[is_Cygwin] && [file exists /usr/local/miga/lib/gui-miga]} {
|
||||||
&& [file exists .pvcsrc]} {
|
|
||||||
proc do_miga {} {
|
proc do_miga {} {
|
||||||
global ui_status_value
|
global ui_status_value
|
||||||
if {![lock_index update]} return
|
if {![lock_index update]} return
|
||||||
@ -1621,7 +1622,7 @@ unset browser doc_path doc_url
|
|||||||
|
|
||||||
# -- Standard bindings
|
# -- Standard bindings
|
||||||
#
|
#
|
||||||
bind . <Destroy> {if {{%W} eq {.}} do_quit}
|
wm protocol . WM_DELETE_WINDOW do_quit
|
||||||
bind all <$M1B-Key-q> do_quit
|
bind all <$M1B-Key-q> do_quit
|
||||||
bind all <$M1B-Key-Q> do_quit
|
bind all <$M1B-Key-Q> do_quit
|
||||||
bind all <$M1B-Key-w> {destroy [winfo toplevel %W]}
|
bind all <$M1B-Key-w> {destroy [winfo toplevel %W]}
|
||||||
|
@ -272,6 +272,8 @@ constructor new {i_commit i_path} {
|
|||||||
set cursorW %W
|
set cursorW %W
|
||||||
tk_popup $w.ctxm %X %Y
|
tk_popup $w.ctxm %X %Y
|
||||||
"
|
"
|
||||||
|
bind $i <Shift-Tab> "[list focus $w_cviewer];break"
|
||||||
|
bind $i <Tab> "[list focus $w_cviewer];break"
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach i [concat $w_columns $w_cviewer] {
|
foreach i [concat $w_columns $w_cviewer] {
|
||||||
@ -287,9 +289,10 @@ constructor new {i_commit i_path} {
|
|||||||
bind $i <Control-Key-f> {catch {%W yview scroll 1 pages};break}
|
bind $i <Control-Key-f> {catch {%W yview scroll 1 pages};break}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bind $w_cviewer <Shift-Tab> "[list focus $w_file];break"
|
||||||
|
bind $w_cviewer <Tab> "[list focus $w_file];break"
|
||||||
bind $w_cviewer <Button-1> [list focus $w_cviewer]
|
bind $w_cviewer <Button-1> [list focus $w_cviewer]
|
||||||
bind $top <Visibility> [list focus $top]
|
bind $w_file <Visibility> [list focus $w_file]
|
||||||
bind $w_file <Destroy> [list delete_this $this]
|
|
||||||
|
|
||||||
grid configure $w.header -sticky ew
|
grid configure $w.header -sticky ew
|
||||||
grid configure $w.file_pane -sticky nsew
|
grid configure $w.file_pane -sticky nsew
|
||||||
@ -484,7 +487,11 @@ method _read_file {fd jump} {
|
|||||||
} ifdeleted { catch {close $fd} }
|
} ifdeleted { catch {close $fd} }
|
||||||
|
|
||||||
method _exec_blame {cur_w cur_d options cur_s} {
|
method _exec_blame {cur_w cur_d options cur_s} {
|
||||||
set cmd [list nice git blame]
|
set cmd [list]
|
||||||
|
if {![is_Windows] || [is_Cygwin]} {
|
||||||
|
lappend cmd nice
|
||||||
|
}
|
||||||
|
lappend cmd git blame
|
||||||
set cmd [concat $cmd $options]
|
set cmd [concat $cmd $options]
|
||||||
lappend cmd --incremental
|
lappend cmd --incremental
|
||||||
if {$commit eq {}} {
|
if {$commit eq {}} {
|
||||||
|
@ -70,7 +70,6 @@ constructor new {commit} {
|
|||||||
bind $w_list <Right> break
|
bind $w_list <Right> break
|
||||||
|
|
||||||
bind $w_list <Visibility> [list focus $w_list]
|
bind $w_list <Visibility> [list focus $w_list]
|
||||||
bind $w_list <Destroy> [list delete_this $this]
|
|
||||||
set w $w_list
|
set w $w_list
|
||||||
_ls $this $browser_commit
|
_ls $this $browser_commit
|
||||||
return $this
|
return $this
|
||||||
|
@ -120,10 +120,21 @@ proc delete_this {{t {}}} {
|
|||||||
if {[namespace exists $t]} {namespace delete $t}
|
if {[namespace exists $t]} {namespace delete $t}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc make_toplevel {t w} {
|
proc make_toplevel {t w args} {
|
||||||
upvar $t top $w pfx
|
upvar $t top $w pfx this this
|
||||||
|
|
||||||
|
if {[llength $args] % 2} {
|
||||||
|
error "make_toplevel topvar winvar {options}"
|
||||||
|
}
|
||||||
|
set autodelete 1
|
||||||
|
foreach {name value} $args {
|
||||||
|
switch -exact -- $name {
|
||||||
|
-autodelete {set autodelete $value}
|
||||||
|
default {error "unsupported option $name"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if {[winfo ismapped .]} {
|
if {[winfo ismapped .]} {
|
||||||
upvar this this
|
|
||||||
regsub -all {::} $this {__} w
|
regsub -all {::} $this {__} w
|
||||||
set top .$w
|
set top .$w
|
||||||
set pfx $top
|
set pfx $top
|
||||||
@ -132,6 +143,13 @@ proc make_toplevel {t w} {
|
|||||||
set top .
|
set top .
|
||||||
set pfx {}
|
set pfx {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if {$autodelete} {
|
||||||
|
wm protocol $top WM_DELETE_WINDOW "
|
||||||
|
[list delete_this $this]
|
||||||
|
[list destroy $top]
|
||||||
|
"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -151,4 +169,3 @@ auto_mkindex_parser::command constructor {name args} {
|
|||||||
[format { [list source [file join $dir %s]]} \
|
[format { [list source [file join $dir %s]]} \
|
||||||
[file split $scriptFile]] "\n"
|
[file split $scriptFile]] "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ constructor new {short_title long_title} {
|
|||||||
|
|
||||||
method _init {} {
|
method _init {} {
|
||||||
global M1B
|
global M1B
|
||||||
make_toplevel top w
|
make_toplevel top w -autodelete 0
|
||||||
wm title $top "[appname] ([reponame]): $t_short"
|
wm title $top "[appname] ([reponame]): $t_short"
|
||||||
set console_cr 1.0
|
set console_cr 1.0
|
||||||
|
|
||||||
|
@ -125,7 +125,8 @@ Please select fewer branches. To merge more than 15 branches, merge the branche
|
|||||||
set cons [console::new "Merge" $msg]
|
set cons [console::new "Merge" $msg]
|
||||||
console::exec $cons $cmd \
|
console::exec $cons $cmd \
|
||||||
[namespace code [list _finish $revcnt $cons]]
|
[namespace code [list _finish $revcnt $cons]]
|
||||||
bind $w <Destroy> {}
|
|
||||||
|
wm protocol $w WM_DELETE_WINDOW {}
|
||||||
destroy $w
|
destroy $w
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,7 +251,7 @@ proc dialog {} {
|
|||||||
bind $w <$M1B-Key-Return> $_start
|
bind $w <$M1B-Key-Return> $_start
|
||||||
bind $w <Visibility> "grab $w; focus $w.source.l"
|
bind $w <Visibility> "grab $w; focus $w.source.l"
|
||||||
bind $w <Key-Escape> "unlock_index;destroy $w"
|
bind $w <Key-Escape> "unlock_index;destroy $w"
|
||||||
bind $w <Destroy> unlock_index
|
wm protocol $w WM_DELETE_WINDOW "unlock_index;destroy $w"
|
||||||
wm title $w "[appname] ([reponame]): Merge"
|
wm title $w "[appname] ([reponame]): Merge"
|
||||||
tkwait window $w
|
tkwait window $w
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user