Skip to content

Commit

Permalink
Merge git-gui 0.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gitster committed Mar 26, 2011
2 parents 421446b + fbc9629 commit 42f9874
Show file tree
Hide file tree
Showing 14 changed files with 3,371 additions and 437 deletions.
61 changes: 47 additions & 14 deletions git-gui/git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,25 @@ if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {

package require msgcat

# Check for Windows 7 MUI language pack (missed by msgcat < 1.4.4)
if {[tk windowingsystem] eq "win32"
&& [package vcompare [package provide msgcat] 1.4.4] < 0
} then {
proc _mc_update_locale {} {
set key {HKEY_CURRENT_USER\Control Panel\Desktop}
if {![catch {
package require registry
set uilocale [registry get $key "PreferredUILanguages"]
msgcat::ConvertLocale [string map {- _} [lindex $uilocale 0]]
} uilocale]} {
if {[string length $uilocale] > 0} {
msgcat::mclocale $uilocale
}
}
}
_mc_update_locale
}

proc _mc_trim {fmt} {
set cmk [string first @@ $fmt]
if {$cmk > 0} {
Expand Down Expand Up @@ -139,6 +158,10 @@ if {$_trace >= 0} {
set _trace 0
}

# variable for the last merged branch (useful for a default when deleting
# branches).
set _last_merged_branch {}

proc shellpath {} {
global _shellpath env
if {[string match @@* $_shellpath]} {
Expand Down Expand Up @@ -1448,13 +1471,17 @@ proc rescan_stage2 {fd after} {
close $fd
}
set ls_others [list --exclude-per-directory=.gitignore]
if {[have_info_exclude]} {
lappend ls_others "--exclude-from=[gitdir info exclude]"
}
set user_exclude [get_config core.excludesfile]
if {$user_exclude ne {} && [file readable $user_exclude]} {
lappend ls_others "--exclude-from=$user_exclude"
if {[package vsatisfies $::_git_version 1.6.3]} {
set ls_others [list --exclude-standard]
} else {
set ls_others [list --exclude-per-directory=.gitignore]
if {[have_info_exclude]} {
lappend ls_others "--exclude-from=[gitdir info exclude]"
}
set user_exclude [get_config core.excludesfile]
if {$user_exclude ne {} && [file readable $user_exclude]} {
lappend ls_others "--exclude-from=[file normalize $user_exclude]"
}
}
set buf_rdi {}
Expand Down Expand Up @@ -1958,8 +1985,8 @@ static unsigned char file_merge_bits[] = {
} -maskdata $filemask
image create bitmap file_statechange -background white -foreground green -data {
#define file_merge_width 14
#define file_merge_height 15
#define file_statechange_width 14
#define file_statechange_height 15
static unsigned char file_statechange_bits[] = {
0xfe, 0x01, 0x02, 0x03, 0x02, 0x05, 0x02, 0x09, 0x02, 0x1f, 0x62, 0x10,
0x62, 0x10, 0xba, 0x11, 0xba, 0x11, 0x62, 0x10, 0x62, 0x10, 0x02, 0x10,
Expand Down Expand Up @@ -1993,7 +2020,11 @@ foreach i {
{MD {mc "Staged for commit, missing"}}
{_T {mc "File type changed, not staged"}}
{MT {mc "File type changed, old type staged for commit"}}
{AT {mc "File type changed, old type staged for commit"}}
{T_ {mc "File type changed, staged"}}
{TM {mc "File type change staged, modification not staged"}}
{TD {mc "File type change staged, file missing"}}
{_O {mc "Untracked, not staged"}}
{A_ {mc "Staged for commit"}}
Expand Down Expand Up @@ -3331,6 +3362,8 @@ foreach {n c} {0 black 1 red4 2 green4 3 yellow4 4 blue4 5 magenta4 6 cyan4 7 gr
}
$ui_diff tag configure clr1 -font font_diffbold
$ui_diff tag conf d_info -foreground blue -font font_diffbold
$ui_diff tag conf d_cr -elide true
$ui_diff tag conf d_@ -font font_diffbold
$ui_diff tag conf d_+ -foreground {#00a000}
Expand All @@ -3351,13 +3384,13 @@ $ui_diff tag conf d_s- \
-foreground red \
-background ivory1
$ui_diff tag conf d<<<<<<< \
$ui_diff tag conf d< \
-foreground orange \
-font font_diffbold
$ui_diff tag conf d======= \
$ui_diff tag conf d= \
-foreground orange \
-font font_diffbold
$ui_diff tag conf d>>>>>>> \
$ui_diff tag conf d> \
-foreground orange \
-font font_diffbold
Expand Down Expand Up @@ -3533,8 +3566,8 @@ proc popup_diff_menu {ctxm ctxmmg ctxmsm x y X Y} {
|| $current_diff_path eq {}
|| {__} eq $state
|| {_O} eq $state
|| {_T} eq $state
|| {T_} eq $state
|| [string match {?T} $state]
|| [string match {T?} $state]
|| [has_textconv $current_diff_path]} {
set s disabled
} else {
Expand Down
2 changes: 1 addition & 1 deletion git-gui/lib/browser.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ method _parent {} {
if {$browser_stack eq {}} {
regsub {:.*$} $browser_path {:} browser_path
} else {
regsub {/[^/]+$} $browser_path {} browser_path
regsub {/[^/]+/$} $browser_path {/} browser_path
}
set browser_status [mc "Loading %s..." $browser_path]
_ls $this [lindex $parent 0] [lindex $parent 1]
Expand Down
14 changes: 3 additions & 11 deletions git-gui/lib/choose_repository.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,6 @@ constructor pick {} {
}
}

proc _home {} {
if {[catch {set h $::env(HOME)}]
|| ![file isdirectory $h]} {
set h .
}
return $h
}

method _center {} {
set nx [winfo reqwidth $top]
set ny [winfo reqheight $top]
Expand Down Expand Up @@ -420,7 +412,7 @@ method _new_local_path {} {
if {$local_path ne {}} {
set p [file dirname $local_path]
} else {
set p [_home]
set p [pwd]
}

set p [tk_chooseDirectory \
Expand Down Expand Up @@ -541,7 +533,7 @@ method _open_origin {} {
if {$origin_url ne {} && [file isdirectory $origin_url]} {
set p $origin_url
} else {
set p [_home]
set p [pwd]
}

set p [tk_chooseDirectory \
Expand Down Expand Up @@ -1042,7 +1034,7 @@ method _open_local_path {} {
if {$local_path ne {}} {
set p $local_path
} else {
set p [_home]
set p [pwd]
}

set p [tk_chooseDirectory \
Expand Down
9 changes: 7 additions & 2 deletions git-gui/lib/commit.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,12 @@ The rescan will be automatically started now.
#
set files_ready 0
foreach path [array names file_states] {
switch -glob -- [lindex $file_states($path) 0] {
set s $file_states($path)
switch -glob -- [lindex $s 0] {
_? {continue}
A? -
D? -
T_ -
T? -
M? {set files_ready 1}
_U -
U? {
Expand Down Expand Up @@ -452,7 +453,11 @@ A rescan will be automatically started now.
}
AM -
AD -
AT -
TM -
TD -
MM -
MT -
MD {
set file_states($path) [list \
_[string index $m 1] \
Expand Down
Loading

0 comments on commit 42f9874

Please sign in to comment.