Compare commits
16 Commits
gitgui-0.1
...
gitgui-0.1
Author | SHA1 | Date | |
---|---|---|---|
942e6baa92 | |||
7d076d5675 | |||
215d4fdbaa | |||
af86768334 | |||
6f01e20e25 | |||
d8d166bf09 | |||
f49517a862 | |||
54531e7c7a | |||
3f2fb173ac | |||
9af6413b96 | |||
4198579b0a | |||
95fa862b57 | |||
ff3f01bba9 | |||
f9ace9e63d | |||
508dee31f3 | |||
80e6667809 |
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1,3 +1,4 @@
|
|||||||
|
* whitespace=indent-with-non-tab,trailing-space,space-before-tab,tabwidth=4
|
||||||
* encoding=US-ASCII
|
* encoding=US-ASCII
|
||||||
git-gui.sh encoding=UTF-8
|
git-gui.sh encoding=UTF-8
|
||||||
/po/*.po encoding=UTF-8
|
/po/*.po encoding=UTF-8
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
GVF=GIT-VERSION-FILE
|
GVF=GIT-VERSION-FILE
|
||||||
DEF_VER=0.13.GITGUI
|
DEF_VER=0.16.GITGUI
|
||||||
|
|
||||||
LF='
|
LF='
|
||||||
'
|
'
|
||||||
|
38
git-gui.sh
38
git-gui.sh
@ -464,6 +464,35 @@ proc _which {what args} {
|
|||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Test a file for a hashbang to identify executable scripts on Windows.
|
||||||
|
proc is_shellscript {filename} {
|
||||||
|
if {![file exists $filename]} {return 0}
|
||||||
|
set f [open $filename r]
|
||||||
|
fconfigure $f -encoding binary
|
||||||
|
set magic [read $f 2]
|
||||||
|
close $f
|
||||||
|
return [expr {$magic eq "#!"}]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Run a command connected via pipes on stdout.
|
||||||
|
# This is for use with textconv filters and uses sh -c "..." to allow it to
|
||||||
|
# contain a command with arguments. On windows we must check for shell
|
||||||
|
# scripts specifically otherwise just call the filter command.
|
||||||
|
proc open_cmd_pipe {cmd path} {
|
||||||
|
global env
|
||||||
|
if {![file executable [shellpath]]} {
|
||||||
|
set exe [auto_execok [lindex $cmd 0]]
|
||||||
|
if {[is_shellscript [lindex $exe 0]]} {
|
||||||
|
set run [linsert [auto_execok sh] end -c "$cmd \"\$0\"" $path]
|
||||||
|
} else {
|
||||||
|
set run [concat $exe [lrange $cmd 1 end] $path]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
set run [list [shellpath] -c "$cmd \"\$0\"" $path]
|
||||||
|
}
|
||||||
|
return [open |$run r]
|
||||||
|
}
|
||||||
|
|
||||||
proc _lappend_nice {cmd_var} {
|
proc _lappend_nice {cmd_var} {
|
||||||
global _nice
|
global _nice
|
||||||
upvar $cmd_var cmd
|
upvar $cmd_var cmd
|
||||||
@ -729,7 +758,10 @@ if {[is_Windows]} {
|
|||||||
gitlogo put gray26 -to 5 15 11 16
|
gitlogo put gray26 -to 5 15 11 16
|
||||||
gitlogo redither
|
gitlogo redither
|
||||||
|
|
||||||
wm iconphoto . -default gitlogo
|
image create photo gitlogo32 -width 32 -height 32
|
||||||
|
gitlogo32 copy gitlogo -zoom 2 2
|
||||||
|
|
||||||
|
wm iconphoto . -default gitlogo gitlogo32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -850,6 +882,7 @@ set default_config(gui.fastcopyblame) false
|
|||||||
set default_config(gui.copyblamethreshold) 40
|
set default_config(gui.copyblamethreshold) 40
|
||||||
set default_config(gui.blamehistoryctx) 7
|
set default_config(gui.blamehistoryctx) 7
|
||||||
set default_config(gui.diffcontext) 5
|
set default_config(gui.diffcontext) 5
|
||||||
|
set default_config(gui.diffopts) {}
|
||||||
set default_config(gui.commitmsgwidth) 75
|
set default_config(gui.commitmsgwidth) 75
|
||||||
set default_config(gui.newbranchtemplate) {}
|
set default_config(gui.newbranchtemplate) {}
|
||||||
set default_config(gui.spellingdictionary) {}
|
set default_config(gui.spellingdictionary) {}
|
||||||
@ -3376,6 +3409,7 @@ foreach {n c} {0 black 1 red4 2 green4 3 yellow4 4 blue4 5 magenta4 6 cyan4 7 gr
|
|||||||
$ui_diff tag configure clri3$n -background $c
|
$ui_diff tag configure clri3$n -background $c
|
||||||
}
|
}
|
||||||
$ui_diff tag configure clr1 -font font_diffbold
|
$ui_diff tag configure clr1 -font font_diffbold
|
||||||
|
$ui_diff tag configure clr4 -underline 1
|
||||||
|
|
||||||
$ui_diff tag conf d_info -foreground blue -font font_diffbold
|
$ui_diff tag conf d_info -foreground blue -font font_diffbold
|
||||||
|
|
||||||
@ -3892,7 +3926,7 @@ after 1 {
|
|||||||
$ui_comm configure -state disabled -background gray
|
$ui_comm configure -state disabled -background gray
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if {[is_enabled multicommit]} {
|
if {[is_enabled multicommit] && ![is_config_false gui.gcwarning]} {
|
||||||
after 1000 hint_gc
|
after 1000 hint_gc
|
||||||
}
|
}
|
||||||
if {[is_enabled retcode]} {
|
if {[is_enabled retcode]} {
|
||||||
|
@ -219,7 +219,8 @@ constructor new {i_commit i_path i_jump} {
|
|||||||
eval grid $w_columns $w.file_pane.out.sby -sticky nsew
|
eval grid $w_columns $w.file_pane.out.sby -sticky nsew
|
||||||
grid conf \
|
grid conf \
|
||||||
$w.file_pane.out.sbx \
|
$w.file_pane.out.sbx \
|
||||||
-column [expr {[llength $w_columns] - 1}] \
|
-column 0 \
|
||||||
|
-columnspan [expr {[llength $w_columns] + 1}] \
|
||||||
-sticky we
|
-sticky we
|
||||||
grid columnconfigure \
|
grid columnconfigure \
|
||||||
$w.file_pane.out \
|
$w.file_pane.out \
|
||||||
@ -229,12 +230,14 @@ constructor new {i_commit i_path i_jump} {
|
|||||||
|
|
||||||
set finder [::searchbar::new \
|
set finder [::searchbar::new \
|
||||||
$w.file_pane.out.ff $w_file \
|
$w.file_pane.out.ff $w_file \
|
||||||
-column [expr {[llength $w_columns] - 1}] \
|
-column 0 \
|
||||||
|
-columnspan [expr {[llength $w_columns] + 1}] \
|
||||||
]
|
]
|
||||||
|
|
||||||
set gotoline [::linebar::new \
|
set gotoline [::linebar::new \
|
||||||
$w.file_pane.out.lf $w_file \
|
$w.file_pane.out.lf $w_file \
|
||||||
-column [expr {[llength $w_columns] - 1}] \
|
-column 0 \
|
||||||
|
-columnspan [expr {[llength $w_columns] + 1}] \
|
||||||
]
|
]
|
||||||
|
|
||||||
set w_cviewer $w.file_pane.cm.t
|
set w_cviewer $w.file_pane.cm.t
|
||||||
@ -473,14 +476,7 @@ method _load {jump} {
|
|||||||
}
|
}
|
||||||
if {$commit eq {}} {
|
if {$commit eq {}} {
|
||||||
if {$do_textconv ne 0} {
|
if {$do_textconv ne 0} {
|
||||||
# Run textconv with sh -c "..." to allow it to
|
set fd [open_cmd_pipe $textconv $path]
|
||||||
# contain command + arguments. On windows, just
|
|
||||||
# call the filter command.
|
|
||||||
if {![file executable [shellpath]]} {
|
|
||||||
set fd [open |[linsert $textconv end $path] r]
|
|
||||||
} else {
|
|
||||||
set fd [open |[list [shellpath] -c "$textconv \"\$0\"" $path] r]
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
set fd [open $path r]
|
set fd [open $path r]
|
||||||
}
|
}
|
||||||
@ -572,7 +568,11 @@ method _read_file {fd jump} {
|
|||||||
foreach i $w_columns {$i conf -state disabled}
|
foreach i $w_columns {$i conf -state disabled}
|
||||||
|
|
||||||
if {[eof $fd]} {
|
if {[eof $fd]} {
|
||||||
close $fd
|
fconfigure $fd -blocking 1; # enable error reporting on close
|
||||||
|
if {[catch {close $fd} err]} {
|
||||||
|
tk_messageBox -icon error -title [mc Error] \
|
||||||
|
-message $err
|
||||||
|
}
|
||||||
|
|
||||||
# If we don't force Tk to update the widgets *right now*
|
# If we don't force Tk to update the widgets *right now*
|
||||||
# none of our jump commands will cause a change in the UI.
|
# none of our jump commands will cause a change in the UI.
|
||||||
@ -1062,7 +1062,7 @@ method _gitkcommit {} {
|
|||||||
set radius [get_config gui.blamehistoryctx]
|
set radius [get_config gui.blamehistoryctx]
|
||||||
set cmdline [list --select-commit=$cmit]
|
set cmdline [list --select-commit=$cmit]
|
||||||
|
|
||||||
if {$radius > 0} {
|
if {$radius > 0} {
|
||||||
set author_time {}
|
set author_time {}
|
||||||
set committer_time {}
|
set committer_time {}
|
||||||
|
|
||||||
@ -1170,7 +1170,7 @@ method _read_diff_load_commit {fd cparent new_path tline} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if {[eof $fd]} {
|
if {[eof $fd]} {
|
||||||
close $fd;
|
close $fd
|
||||||
set current_fd {}
|
set current_fd {}
|
||||||
|
|
||||||
_load_new_commit $this \
|
_load_new_commit $this \
|
||||||
@ -1201,6 +1201,7 @@ method _open_tooltip {cur_w} {
|
|||||||
_hide_tooltip $this
|
_hide_tooltip $this
|
||||||
|
|
||||||
set tooltip_wm [toplevel $cur_w.tooltip -borderwidth 1]
|
set tooltip_wm [toplevel $cur_w.tooltip -borderwidth 1]
|
||||||
|
catch {wm attributes $tooltip_wm -type tooltip}
|
||||||
wm overrideredirect $tooltip_wm 1
|
wm overrideredirect $tooltip_wm 1
|
||||||
wm transient $tooltip_wm [winfo toplevel $cur_w]
|
wm transient $tooltip_wm [winfo toplevel $cur_w]
|
||||||
set tooltip_t $tooltip_wm.label
|
set tooltip_t $tooltip_wm.label
|
||||||
|
@ -26,8 +26,14 @@ constructor new {commit {path {}}} {
|
|||||||
wm withdraw $top
|
wm withdraw $top
|
||||||
wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]]
|
wm title $top [append "[appname] ([reponame]): " [mc "File Browser"]]
|
||||||
|
|
||||||
|
if {$path ne {}} {
|
||||||
|
if {[string index $path end] ne {/}} {
|
||||||
|
append path /
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
set browser_commit $commit
|
set browser_commit $commit
|
||||||
set browser_path $browser_commit:$path
|
set browser_path "$browser_commit:[escape_path $path]"
|
||||||
|
|
||||||
${NS}::label $w.path \
|
${NS}::label $w.path \
|
||||||
-textvariable @browser_path \
|
-textvariable @browser_path \
|
||||||
|
@ -497,6 +497,7 @@ method _open_tooltip {} {
|
|||||||
|
|
||||||
if {$tooltip_wm eq {}} {
|
if {$tooltip_wm eq {}} {
|
||||||
set tooltip_wm [toplevel $w_list.tooltip -borderwidth 1]
|
set tooltip_wm [toplevel $w_list.tooltip -borderwidth 1]
|
||||||
|
catch {wm attributes $tooltip_wm -type tooltip}
|
||||||
wm overrideredirect $tooltip_wm 1
|
wm overrideredirect $tooltip_wm 1
|
||||||
wm transient $tooltip_wm [winfo toplevel $w_list]
|
wm transient $tooltip_wm [winfo toplevel $w_list]
|
||||||
set tooltip_t $tooltip_wm.label
|
set tooltip_t $tooltip_wm.label
|
||||||
|
@ -138,6 +138,7 @@ proc make_dialog {t w args} {
|
|||||||
upvar $t top $w pfx this this
|
upvar $t top $w pfx this this
|
||||||
global use_ttk
|
global use_ttk
|
||||||
uplevel [linsert $args 0 make_toplevel $t $w]
|
uplevel [linsert $args 0 make_toplevel $t $w]
|
||||||
|
catch {wm attributes $top -type dialog}
|
||||||
pave_toplevel $pfx
|
pave_toplevel $pfx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +263,9 @@ proc commit_commitmsg {curHEAD msg_p} {
|
|||||||
global is_detached repo_config
|
global is_detached repo_config
|
||||||
global pch_error
|
global pch_error
|
||||||
|
|
||||||
if {$is_detached && $repo_config(gui.warndetachedcommit)} {
|
if {$is_detached
|
||||||
|
&& ![file exists [gitdir rebase-merge head-name]]
|
||||||
|
&& [is_config_true gui.warndetachedcommit]} {
|
||||||
set msg [mc "You are about to commit on a detached head.\
|
set msg [mc "You are about to commit on a detached head.\
|
||||||
This is a potentially dangerous thing to do because if you switch\
|
This is a potentially dangerous thing to do because if you switch\
|
||||||
to another branch you will loose your changes and it can be difficult\
|
to another branch you will loose your changes and it can be difficult\
|
||||||
|
@ -309,6 +309,7 @@ proc start_show_diff {cont_info {add_opts {}}} {
|
|||||||
|
|
||||||
lappend cmd -p
|
lappend cmd -p
|
||||||
lappend cmd --color
|
lappend cmd --color
|
||||||
|
set cmd [concat $cmd $repo_config(gui.diffopts)]
|
||||||
if {$repo_config(gui.diffcontext) >= 1} {
|
if {$repo_config(gui.diffcontext) >= 1} {
|
||||||
lappend cmd "-U$repo_config(gui.diffcontext)"
|
lappend cmd "-U$repo_config(gui.diffcontext)"
|
||||||
}
|
}
|
||||||
@ -502,9 +503,9 @@ proc read_diff {fd conflict_size cont_info} {
|
|||||||
|
|
||||||
foreach {posbegin colbegin posend colend} $markup {
|
foreach {posbegin colbegin posend colend} $markup {
|
||||||
set prefix clr
|
set prefix clr
|
||||||
foreach style [split $colbegin ";"] {
|
foreach style [lsort -integer [split $colbegin ";"]] {
|
||||||
if {$style eq "7"} {append prefix i; continue}
|
if {$style eq "7"} {append prefix i; continue}
|
||||||
if {$style < 30 || $style > 47} {continue}
|
if {$style != 4 && ($style < 30 || $style > 47)} {continue}
|
||||||
set a "$mark linestart + $posbegin chars"
|
set a "$mark linestart + $posbegin chars"
|
||||||
set b "$mark linestart + $posend chars"
|
set b "$mark linestart + $posend chars"
|
||||||
catch {$ui_diff tag add $prefix$style $a $b}
|
catch {$ui_diff tag add $prefix$style $a $b}
|
||||||
|
@ -153,9 +153,11 @@ proc do_options {} {
|
|||||||
{i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
|
{i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
|
||||||
{i-0..300 gui.blamehistoryctx {mc "Blame History Context Radius (days)"}}
|
{i-0..300 gui.blamehistoryctx {mc "Blame History Context Radius (days)"}}
|
||||||
{i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
|
{i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
|
||||||
|
{t gui.diffopts {mc "Additional Diff Parameters"}}
|
||||||
{i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
|
{i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
|
||||||
{t gui.newbranchtemplate {mc "New Branch Name Template"}}
|
{t gui.newbranchtemplate {mc "New Branch Name Template"}}
|
||||||
{c gui.encoding {mc "Default File Contents Encoding"}}
|
{c gui.encoding {mc "Default File Contents Encoding"}}
|
||||||
|
{b gui.warndetachedcommit {mc "Warn before committing to a detached head"}}
|
||||||
{s gui.stageuntracked {mc "Staging of untracked files"} {list "yes" "no" "ask"}}
|
{s gui.stageuntracked {mc "Staging of untracked files"} {list "yes" "no" "ask"}}
|
||||||
} {
|
} {
|
||||||
set type [lindex $option 0]
|
set type [lindex $option 0]
|
||||||
|
@ -26,11 +26,20 @@ constructor new {i_w i_text args} {
|
|||||||
set ctext $i_text
|
set ctext $i_text
|
||||||
|
|
||||||
set default_regexpsearch [is_config_true gui.search.regexp]
|
set default_regexpsearch [is_config_true gui.search.regexp]
|
||||||
set smartcase [is_config_true gui.search.smartcase]
|
switch -- [get_config gui.search.case] {
|
||||||
if {$smartcase} {
|
no {
|
||||||
set default_casesensitive 0
|
set default_casesensitive 0
|
||||||
} else {
|
set smartcase 0
|
||||||
|
}
|
||||||
|
smart {
|
||||||
|
set default_casesensitive 0
|
||||||
|
set smartcase 1
|
||||||
|
}
|
||||||
|
yes -
|
||||||
|
default {
|
||||||
set default_casesensitive 1
|
set default_casesensitive 1
|
||||||
|
set smartcase 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set history [list]
|
set history [list]
|
||||||
@ -157,12 +166,10 @@ method _incrsearch {} {
|
|||||||
if {[catch {$ctext index anchor}]} {
|
if {[catch {$ctext index anchor}]} {
|
||||||
$ctext mark set anchor [_get_new_anchor $this]
|
$ctext mark set anchor [_get_new_anchor $this]
|
||||||
}
|
}
|
||||||
if {$smartcase} {
|
if {$searchstring ne {}} {
|
||||||
if {[regexp {[[:upper:]]} $searchstring]} {
|
if {$smartcase && [regexp {[[:upper:]]} $searchstring]} {
|
||||||
set casesensitive 1
|
set casesensitive 1
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if {$searchstring ne {}} {
|
|
||||||
set here [_do_search $this anchor mlen]
|
set here [_do_search $this anchor mlen]
|
||||||
if {$here ne {}} {
|
if {$here ne {}} {
|
||||||
$ctext see $here
|
$ctext see $here
|
||||||
@ -175,6 +182,9 @@ method _incrsearch {} {
|
|||||||
#$w.ent configure -background lightpink
|
#$w.ent configure -background lightpink
|
||||||
$w.ent state pressed
|
$w.ent state pressed
|
||||||
}
|
}
|
||||||
|
} elseif {$smartcase} {
|
||||||
|
# clearing the field resets the smart case detection
|
||||||
|
set casesensitive 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ proc read_sshkey_output {fd w} {
|
|||||||
} else {
|
} else {
|
||||||
set finfo [find_ssh_key]
|
set finfo [find_ssh_key]
|
||||||
if {$finfo eq {}} {
|
if {$finfo eq {}} {
|
||||||
set sshkey_title [mc "Generation succeded, but no keys found."]
|
set sshkey_title [mc "Generation succeeded, but no keys found."]
|
||||||
$w.contents insert end $sshkey_output
|
$w.contents insert end $sshkey_output
|
||||||
} else {
|
} else {
|
||||||
set sshkey_title [mc "Your key is in: %s" [lindex $finfo 0]]
|
set sshkey_title [mc "Your key is in: %s" [lindex $finfo 0]]
|
||||||
|
@ -123,6 +123,7 @@ proc paddedlabel {w args} {
|
|||||||
# place a themed frame over the surface.
|
# place a themed frame over the surface.
|
||||||
proc Dialog {w args} {
|
proc Dialog {w args} {
|
||||||
eval [linsert $args 0 toplevel $w -class Dialog]
|
eval [linsert $args 0 toplevel $w -class Dialog]
|
||||||
|
catch {wm attributes $w -type dialog}
|
||||||
pave_toplevel $w
|
pave_toplevel $w
|
||||||
return $w
|
return $w
|
||||||
}
|
}
|
||||||
|
@ -87,8 +87,14 @@ proc tools_exec {fullname} {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
} elseif {[is_config_true "guitool.$fullname.confirm"]} {
|
} elseif {[is_config_true "guitool.$fullname.confirm"]} {
|
||||||
if {[ask_popup [mc "Are you sure you want to run %s?" $fullname]] ne {yes}} {
|
if {[is_config_true "guitool.$fullname.needsfile"]} {
|
||||||
return
|
if {[ask_popup [mc "Are you sure you want to run %1\$s on file \"%2\$s\"?" $fullname $current_diff_path]] ne {yes}} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if {[ask_popup [mc "Are you sure you want to run %s?" $fullname]] ne {yes}} {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,6 +124,7 @@ proc do_push_anywhere {} {
|
|||||||
|
|
||||||
set w .push_setup
|
set w .push_setup
|
||||||
toplevel $w
|
toplevel $w
|
||||||
|
catch {wm attributes $w -type dialog}
|
||||||
wm withdraw $w
|
wm withdraw $w
|
||||||
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
|
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
|
||||||
pave_toplevel $w
|
pave_toplevel $w
|
||||||
|
Reference in New Issue
Block a user