mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
Merge commit 'git-gui/master' into work/git-gui
This commit is contained in:
1
git-gui/.gitignore
vendored
1
git-gui/.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
.DS_Store
|
||||
config.mak
|
||||
Git Gui.app*
|
||||
git-gui.tcl
|
||||
GIT-VERSION-FILE
|
||||
|
||||
@@ -19,6 +19,10 @@ GITGUI_MAIN := git-gui
|
||||
GITGUI_BUILT_INS = git-citool
|
||||
ALL_LIBFILES = $(wildcard lib/*.tcl)
|
||||
PRELOAD_FILES = lib/class.tcl
|
||||
NONTCL_LIBFILES = \
|
||||
lib/git-gui.ico \
|
||||
$(wildcard lib/win32_*.js) \
|
||||
#end NONTCL_LIBFILES
|
||||
|
||||
ifndef SHELL_PATH
|
||||
SHELL_PATH = /bin/sh
|
||||
@@ -95,6 +99,8 @@ ifeq ($(findstring $(MAKEFLAGS),s),s)
|
||||
QUIET_GEN =
|
||||
endif
|
||||
|
||||
-include config.mak
|
||||
|
||||
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
|
||||
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
|
||||
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
|
||||
@@ -255,12 +261,11 @@ ifdef GITGUI_WINDOWS_WRAPPER
|
||||
endif
|
||||
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(INSTALL_D1)
|
||||
$(QUIET)$(INSTALL_R0)lib/tclIndex $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)'
|
||||
$(QUIET)$(INSTALL_R0)lib/git-gui.ico $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)'
|
||||
ifdef GITGUI_MACOSXAPP
|
||||
$(QUIET)$(INSTALL_A0)'Git Gui.app' $(INSTALL_A1) '$(DESTDIR_SQ)$(libdir_SQ)'
|
||||
$(QUIET)$(INSTALL_X0)git-gui.tcl $(INSTALL_X1) '$(DESTDIR_SQ)$(libdir_SQ)'
|
||||
endif
|
||||
$(QUIET)$(foreach p,$(ALL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
|
||||
$(QUIET)$(foreach p,$(ALL_LIBFILES) $(NONTCL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
|
||||
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
|
||||
$(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
|
||||
|
||||
@@ -273,12 +278,11 @@ ifdef GITGUI_WINDOWS_WRAPPER
|
||||
endif
|
||||
$(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(libdir_SQ)'
|
||||
$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/tclIndex $(REMOVE_F1)
|
||||
$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/git-gui.ico $(REMOVE_F1)
|
||||
ifdef GITGUI_MACOSXAPP
|
||||
$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)/Git Gui.app' $(REMOVE_F1)
|
||||
$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/git-gui.tcl $(REMOVE_F1)
|
||||
endif
|
||||
$(QUIET)$(foreach p,$(ALL_LIBFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true
|
||||
$(QUIET)$(foreach p,$(ALL_LIBFILES) $(NONTCL_LIBFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(libdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true
|
||||
$(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(msgsdir_SQ)'
|
||||
$(QUIET)$(foreach p,$(ALL_MSGFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true
|
||||
$(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(REMOVE_D1)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
exec wish "$argv0" -- "$@"
|
||||
|
||||
set appvers {@@GITGUI_VERSION@@}
|
||||
set copyright {
|
||||
set copyright [encoding convertfrom utf-8 {
|
||||
Copyright © 2006, 2007 Shawn Pearce, et. al.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -25,7 +25,7 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}]
|
||||
|
||||
######################################################################
|
||||
##
|
||||
@@ -205,6 +205,7 @@ proc disable_option {option} {
|
||||
|
||||
proc is_many_config {name} {
|
||||
switch -glob -- $name {
|
||||
gui.recentrepo -
|
||||
remote.*.fetch -
|
||||
remote.*.push
|
||||
{return 1}
|
||||
@@ -233,51 +234,6 @@ proc get_config {name} {
|
||||
}
|
||||
}
|
||||
|
||||
proc load_config {include_global} {
|
||||
global repo_config global_config default_config
|
||||
|
||||
array unset global_config
|
||||
if {$include_global} {
|
||||
catch {
|
||||
set fd_rc [git_read config --global --list]
|
||||
while {[gets $fd_rc line] >= 0} {
|
||||
if {[regexp {^([^=]+)=(.*)$} $line line name value]} {
|
||||
if {[is_many_config $name]} {
|
||||
lappend global_config($name) $value
|
||||
} else {
|
||||
set global_config($name) $value
|
||||
}
|
||||
}
|
||||
}
|
||||
close $fd_rc
|
||||
}
|
||||
}
|
||||
|
||||
array unset repo_config
|
||||
catch {
|
||||
set fd_rc [git_read config --list]
|
||||
while {[gets $fd_rc line] >= 0} {
|
||||
if {[regexp {^([^=]+)=(.*)$} $line line name value]} {
|
||||
if {[is_many_config $name]} {
|
||||
lappend repo_config($name) $value
|
||||
} else {
|
||||
set repo_config($name) $value
|
||||
}
|
||||
}
|
||||
}
|
||||
close $fd_rc
|
||||
}
|
||||
|
||||
foreach name [array names default_config] {
|
||||
if {[catch {set v $global_config($name)}]} {
|
||||
set global_config($name) $default_config($name)
|
||||
}
|
||||
if {[catch {set v $repo_config($name)}]} {
|
||||
set repo_config($name) $default_config($name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
######################################################################
|
||||
##
|
||||
## handy utils
|
||||
@@ -789,6 +745,68 @@ if {$idx ne {}} {
|
||||
}
|
||||
unset -nocomplain idx fd
|
||||
|
||||
######################################################################
|
||||
##
|
||||
## config file parsing
|
||||
|
||||
git-version proc _parse_config {arr_name args} {
|
||||
>= 1.5.3 {
|
||||
upvar $arr_name arr
|
||||
array unset arr
|
||||
set buf {}
|
||||
catch {
|
||||
set fd_rc [eval [list git_read config --null --list] $args]
|
||||
fconfigure $fd_rc -translation binary
|
||||
set buf [read $fd_rc]
|
||||
close $fd_rc
|
||||
}
|
||||
foreach line [split $buf "\0"] {
|
||||
if {[regexp {^([^\n]+)\n(.*)$} $line line name value]} {
|
||||
if {[is_many_config $name]} {
|
||||
lappend arr($name) $value
|
||||
} else {
|
||||
set arr($name) $value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
default {
|
||||
upvar $arr_name arr
|
||||
array unset arr
|
||||
catch {
|
||||
set fd_rc [eval [list git_read config --list] $args]
|
||||
while {[gets $fd_rc line] >= 0} {
|
||||
if {[regexp {^([^=]+)=(.*)$} $line line name value]} {
|
||||
if {[is_many_config $name]} {
|
||||
lappend arr($name) $value
|
||||
} else {
|
||||
set arr($name) $value
|
||||
}
|
||||
}
|
||||
}
|
||||
close $fd_rc
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc load_config {include_global} {
|
||||
global repo_config global_config default_config
|
||||
|
||||
if {$include_global} {
|
||||
_parse_config global_config --global
|
||||
}
|
||||
_parse_config repo_config
|
||||
|
||||
foreach name [array names default_config] {
|
||||
if {[catch {set v $global_config($name)}]} {
|
||||
set global_config($name) $default_config($name)
|
||||
}
|
||||
if {[catch {set v $repo_config($name)}]} {
|
||||
set repo_config($name) $default_config($name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
######################################################################
|
||||
##
|
||||
## feature option selection
|
||||
@@ -1658,8 +1676,8 @@ proc do_quit {} {
|
||||
#
|
||||
set cfg_geometry [list]
|
||||
lappend cfg_geometry [wm geometry .]
|
||||
lappend cfg_geometry [lindex [.vpane sash coord 0] 1]
|
||||
lappend cfg_geometry [lindex [.vpane.files sash coord 0] 0]
|
||||
lappend cfg_geometry [lindex [.vpane sash coord 0] 0]
|
||||
lappend cfg_geometry [lindex [.vpane.files sash coord 0] 1]
|
||||
if {[catch {set rc_geometry $repo_config(gui.geometry)}]} {
|
||||
set rc_geometry {}
|
||||
}
|
||||
@@ -2208,8 +2226,8 @@ pack .branch -side top -fill x
|
||||
|
||||
# -- Main Window Layout
|
||||
#
|
||||
panedwindow .vpane -orient vertical
|
||||
panedwindow .vpane.files -orient horizontal
|
||||
panedwindow .vpane -orient horizontal
|
||||
panedwindow .vpane.files -orient vertical
|
||||
.vpane add .vpane.files -sticky nsew -height 100 -width 200
|
||||
pack .vpane -anchor n -side top -fill both -expand 1
|
||||
|
||||
@@ -2231,7 +2249,6 @@ pack .vpane.files.index.title -side top -fill x
|
||||
pack .vpane.files.index.sx -side bottom -fill x
|
||||
pack .vpane.files.index.sy -side right -fill y
|
||||
pack $ui_index -side left -fill both -expand 1
|
||||
.vpane.files add .vpane.files.index -sticky nsew
|
||||
|
||||
# -- Working Directory File List
|
||||
#
|
||||
@@ -2251,7 +2268,9 @@ pack .vpane.files.workdir.title -side top -fill x
|
||||
pack .vpane.files.workdir.sx -side bottom -fill x
|
||||
pack .vpane.files.workdir.sy -side right -fill y
|
||||
pack $ui_workdir -side left -fill both -expand 1
|
||||
|
||||
.vpane.files add .vpane.files.workdir -sticky nsew
|
||||
.vpane.files add .vpane.files.index -sticky nsew
|
||||
|
||||
foreach i [list $ui_index $ui_workdir] {
|
||||
rmsel_tag $i
|
||||
@@ -2264,8 +2283,8 @@ unset i
|
||||
frame .vpane.lower -height 300 -width 400
|
||||
frame .vpane.lower.commarea
|
||||
frame .vpane.lower.diff -relief sunken -borderwidth 1
|
||||
pack .vpane.lower.commarea -side top -fill x
|
||||
pack .vpane.lower.diff -side bottom -fill both -expand 1
|
||||
pack .vpane.lower.diff -fill both -expand 1
|
||||
pack .vpane.lower.commarea -side bottom -fill x
|
||||
.vpane add .vpane.lower -sticky nsew
|
||||
|
||||
# -- Commit Area Buttons
|
||||
@@ -2591,11 +2610,11 @@ catch {
|
||||
set gm $repo_config(gui.geometry)
|
||||
wm geometry . [lindex $gm 0]
|
||||
.vpane sash place 0 \
|
||||
[lindex [.vpane sash coord 0] 0] \
|
||||
[lindex $gm 1]
|
||||
[lindex $gm 1] \
|
||||
[lindex [.vpane sash coord 0] 1]
|
||||
.vpane.files sash place 0 \
|
||||
[lindex $gm 2] \
|
||||
[lindex [.vpane.files sash coord 0] 1]
|
||||
[lindex [.vpane.files sash coord 0] 0] \
|
||||
[lindex $gm 2]
|
||||
unset gm
|
||||
}
|
||||
|
||||
|
||||
@@ -7,16 +7,18 @@ field top
|
||||
field w
|
||||
field w_body ; # Widget holding the center content
|
||||
field w_next ; # Next button
|
||||
field w_quit ; # Quit button
|
||||
field o_cons ; # Console object (if active)
|
||||
field w_types ; # List of type buttons in clone
|
||||
field w_recentlist ; # Listbox containing recent repositories
|
||||
|
||||
field action new ; # What action are we going to perform?
|
||||
field done 0 ; # Finished picking the repository?
|
||||
field local_path {} ; # Where this repository is locally
|
||||
field origin_url {} ; # Where we are cloning from
|
||||
field origin_name origin ; # What we shall call 'origin'
|
||||
field clone_type hardlink ; # Type of clone to construct
|
||||
field readtree_err ; # Error output from read-tree (if any)
|
||||
field sorted_recent ; # recent repositories (sorted)
|
||||
|
||||
constructor pick {} {
|
||||
global M1T M1B
|
||||
@@ -28,14 +30,11 @@ constructor pick {} {
|
||||
menu $w.mbar -tearoff 0
|
||||
$top configure -menu $w.mbar
|
||||
|
||||
set m_repo $w.mbar.repository
|
||||
$w.mbar add cascade \
|
||||
-label [mc Repository] \
|
||||
-menu $w.mbar.repository
|
||||
menu $w.mbar.repository
|
||||
$w.mbar.repository add command \
|
||||
-label [mc Quit] \
|
||||
-command exit \
|
||||
-accelerator $M1T-Q
|
||||
-menu $m_repo
|
||||
menu $m_repo
|
||||
|
||||
if {[is_MacOSX]} {
|
||||
$w.mbar add cascade -label [mc Apple] -menu .mbar.apple
|
||||
@@ -58,45 +57,135 @@ constructor pick {} {
|
||||
} else {
|
||||
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
|
||||
bind $top <Key-Escape> [list destroy $top]
|
||||
set m_repo {}
|
||||
}
|
||||
|
||||
pack [git_logo $w.git_logo] -side left -fill y -padx 10 -pady 10
|
||||
|
||||
set w_body $w.body
|
||||
set opts $w_body.options
|
||||
frame $w_body
|
||||
radiobutton $w_body.new \
|
||||
-anchor w \
|
||||
-text [mc "Create New Repository"] \
|
||||
-variable @action \
|
||||
-value new
|
||||
radiobutton $w_body.clone \
|
||||
-anchor w \
|
||||
-text [mc "Clone Existing Repository"] \
|
||||
-variable @action \
|
||||
-value clone
|
||||
radiobutton $w_body.open \
|
||||
-anchor w \
|
||||
-text [mc "Open Existing Repository"] \
|
||||
-variable @action \
|
||||
-value open
|
||||
pack $w_body.new -anchor w -fill x
|
||||
pack $w_body.clone -anchor w -fill x
|
||||
pack $w_body.open -anchor w -fill x
|
||||
text $opts \
|
||||
-cursor $::cursor_ptr \
|
||||
-relief flat \
|
||||
-background [$w_body cget -background] \
|
||||
-wrap none \
|
||||
-spacing1 5 \
|
||||
-width 50 \
|
||||
-height 3
|
||||
pack $opts -anchor w -fill x
|
||||
|
||||
$opts tag conf link_new -foreground blue -underline 1
|
||||
$opts tag bind link_new <1> [cb _next new]
|
||||
$opts insert end [mc "Create New Repository"] link_new
|
||||
$opts insert end "\n"
|
||||
if {$m_repo ne {}} {
|
||||
$m_repo add command \
|
||||
-command [cb _next new] \
|
||||
-accelerator $M1T-N \
|
||||
-label [mc "New..."]
|
||||
bind $top <$M1B-n> [cb _next new]
|
||||
bind $top <$M1B-N> [cb _next new]
|
||||
}
|
||||
|
||||
$opts tag conf link_clone -foreground blue -underline 1
|
||||
$opts tag bind link_clone <1> [cb _next clone]
|
||||
$opts insert end [mc "Clone Existing Repository"] link_clone
|
||||
$opts insert end "\n"
|
||||
if {$m_repo ne {}} {
|
||||
$m_repo add command \
|
||||
-command [cb _next clone] \
|
||||
-accelerator $M1T-C \
|
||||
-label [mc "Clone..."]
|
||||
bind $top <$M1B-c> [cb _next clone]
|
||||
bind $top <$M1B-C> [cb _next clone]
|
||||
}
|
||||
|
||||
$opts tag conf link_open -foreground blue -underline 1
|
||||
$opts tag bind link_open <1> [cb _next open]
|
||||
$opts insert end [mc "Open Existing Repository"] link_open
|
||||
$opts insert end "\n"
|
||||
if {$m_repo ne {}} {
|
||||
$m_repo add command \
|
||||
-command [cb _next open] \
|
||||
-accelerator $M1T-O \
|
||||
-label [mc "Open..."]
|
||||
bind $top <$M1B-o> [cb _next open]
|
||||
bind $top <$M1B-O> [cb _next open]
|
||||
}
|
||||
|
||||
$opts conf -state disabled
|
||||
|
||||
set sorted_recent [_get_recentrepos]
|
||||
if {[llength $sorted_recent] > 0} {
|
||||
if {$m_repo ne {}} {
|
||||
$m_repo add separator
|
||||
$m_repo add command \
|
||||
-state disabled \
|
||||
-label [mc "Recent Repositories"]
|
||||
}
|
||||
|
||||
label $w_body.space
|
||||
label $w_body.recentlabel \
|
||||
-anchor w \
|
||||
-text [mc "Open Recent Repository:"]
|
||||
set w_recentlist $w_body.recentlist
|
||||
text $w_recentlist \
|
||||
-cursor $::cursor_ptr \
|
||||
-relief flat \
|
||||
-background [$w_body.recentlabel cget -background] \
|
||||
-wrap none \
|
||||
-width 50 \
|
||||
-height 10
|
||||
$w_recentlist tag conf link \
|
||||
-foreground blue \
|
||||
-underline 1
|
||||
set home $::env(HOME)
|
||||
if {[is_Cygwin]} {
|
||||
set home [exec cygpath --windows --absolute $home]
|
||||
}
|
||||
set home "[file normalize $home]/"
|
||||
set hlen [string length $home]
|
||||
foreach p $sorted_recent {
|
||||
set path $p
|
||||
if {[string equal -length $hlen $home $p]} {
|
||||
set p "~/[string range $p $hlen end]"
|
||||
}
|
||||
regsub -all "\n" $p "\\n" p
|
||||
$w_recentlist insert end $p link
|
||||
$w_recentlist insert end "\n"
|
||||
|
||||
if {$m_repo ne {}} {
|
||||
$m_repo add command \
|
||||
-command [cb _open_recent_path $path] \
|
||||
-label " $p"
|
||||
}
|
||||
}
|
||||
$w_recentlist conf -state disabled
|
||||
$w_recentlist tag bind link <1> [cb _open_recent %x,%y]
|
||||
pack $w_body.space -anchor w -fill x
|
||||
pack $w_body.recentlabel -anchor w -fill x
|
||||
pack $w_recentlist -anchor w -fill x
|
||||
}
|
||||
pack $w_body -fill x -padx 10 -pady 10
|
||||
|
||||
frame $w.buttons
|
||||
set w_next $w.buttons.next
|
||||
button $w_next \
|
||||
-default active \
|
||||
-text [mc "Next >"] \
|
||||
-command [cb _next]
|
||||
pack $w_next -side right -padx 5
|
||||
button $w.buttons.quit \
|
||||
set w_quit $w.buttons.quit
|
||||
button $w_quit \
|
||||
-text [mc "Quit"] \
|
||||
-command exit
|
||||
pack $w.buttons.quit -side right -padx 5
|
||||
pack $w_quit -side right -padx 5
|
||||
pack $w.buttons -side bottom -fill x -padx 10 -pady 10
|
||||
|
||||
if {$m_repo ne {}} {
|
||||
$m_repo add separator
|
||||
$m_repo add command \
|
||||
-label [mc Quit] \
|
||||
-command exit \
|
||||
-accelerator $M1T-Q
|
||||
}
|
||||
|
||||
bind $top <Return> [cb _invoke_next]
|
||||
bind $top <Visibility> "
|
||||
[cb _center]
|
||||
@@ -134,8 +223,61 @@ method _invoke_next {} {
|
||||
}
|
||||
}
|
||||
|
||||
method _next {} {
|
||||
proc _get_recentrepos {} {
|
||||
set recent [list]
|
||||
foreach p [get_config gui.recentrepo] {
|
||||
if {[_is_git [file join $p .git]]} {
|
||||
lappend recent $p
|
||||
}
|
||||
}
|
||||
return [lsort $recent]
|
||||
}
|
||||
|
||||
proc _unset_recentrepo {p} {
|
||||
regsub -all -- {([()\[\]{}\.^$+*?\\])} $p {\\\1} p
|
||||
git config --global --unset gui.recentrepo "^$p\$"
|
||||
}
|
||||
|
||||
proc _append_recentrepos {path} {
|
||||
set path [file normalize $path]
|
||||
set recent [get_config gui.recentrepo]
|
||||
|
||||
if {[lindex $recent end] eq $path} {
|
||||
return
|
||||
}
|
||||
|
||||
set i [lsearch $recent $path]
|
||||
if {$i >= 0} {
|
||||
_unset_recentrepo $path
|
||||
set recent [lreplace $recent $i $i]
|
||||
}
|
||||
|
||||
lappend recent $path
|
||||
git config --global --add gui.recentrepo $path
|
||||
|
||||
while {[llength $recent] > 10} {
|
||||
_unset_recentrepo [lindex $recent 0]
|
||||
set recent [lrange $recent 1 end]
|
||||
}
|
||||
}
|
||||
|
||||
method _open_recent {xy} {
|
||||
set id [lindex [split [$w_recentlist index @$xy] .] 0]
|
||||
set local_path [lindex $sorted_recent [expr {$id - 1}]]
|
||||
_do_open2 $this
|
||||
}
|
||||
|
||||
method _open_recent_path {p} {
|
||||
set local_path $p
|
||||
_do_open2 $this
|
||||
}
|
||||
|
||||
method _next {action} {
|
||||
destroy $w_body
|
||||
if {![winfo exists $w_next]} {
|
||||
button $w_next -default active
|
||||
pack $w_next -side right -padx 5 -before $w_quit
|
||||
}
|
||||
_do_$action $this
|
||||
}
|
||||
|
||||
@@ -174,6 +316,7 @@ method _git_init {} {
|
||||
return 0
|
||||
}
|
||||
|
||||
_append_recentrepos [pwd]
|
||||
set ::_gitdir .git
|
||||
set ::_prefix {}
|
||||
return 1
|
||||
@@ -185,9 +328,42 @@ proc _is_git {path} {
|
||||
&& [file exists [file join $path config]]} {
|
||||
return 1
|
||||
}
|
||||
if {[is_Cygwin]} {
|
||||
if {[file exists [file join $path HEAD]]
|
||||
&& [file exists [file join $path objects.lnk]]
|
||||
&& [file exists [file join $path config.lnk]]} {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
proc _objdir {path} {
|
||||
set objdir [file join $path .git objects]
|
||||
if {[file isdirectory $objdir]} {
|
||||
return $objdir
|
||||
}
|
||||
|
||||
set objdir [file join $path objects]
|
||||
if {[file isdirectory $objdir]} {
|
||||
return $objdir
|
||||
}
|
||||
|
||||
if {[is_Cygwin]} {
|
||||
set objdir [file join $path .git objects.lnk]
|
||||
if {[file isfile $objdir]} {
|
||||
return [win32_read_lnk $objdir]
|
||||
}
|
||||
|
||||
set objdir [file join $path objects.lnk]
|
||||
if {[file isfile $objdir]} {
|
||||
return [win32_read_lnk $objdir]
|
||||
}
|
||||
}
|
||||
|
||||
return {}
|
||||
}
|
||||
|
||||
######################################################################
|
||||
##
|
||||
## Create New Repository
|
||||
@@ -221,6 +397,7 @@ method _do_new {} {
|
||||
pack $w_body.where -fill x
|
||||
|
||||
trace add variable @local_path write [cb _write_local_path]
|
||||
bind $w_body.h <Destroy> [list trace remove variable @local_path write [cb _write_local_path]]
|
||||
update
|
||||
focus $w_body.where.t
|
||||
}
|
||||
@@ -346,6 +523,10 @@ method _do_clone {} {
|
||||
|
||||
trace add variable @local_path write [cb _update_clone]
|
||||
trace add variable @origin_url write [cb _update_clone]
|
||||
bind $w_body.h <Destroy> "
|
||||
[list trace remove variable @local_path write [cb _update_clone]]
|
||||
[list trace remove variable @origin_url write [cb _update_clone]]
|
||||
"
|
||||
update
|
||||
focus $args.origin_t
|
||||
}
|
||||
@@ -411,13 +592,10 @@ method _do_clone2 {} {
|
||||
}
|
||||
|
||||
if {$clone_type eq {hardlink} || $clone_type eq {shared}} {
|
||||
set objdir [file join $origin_url .git objects]
|
||||
if {![file isdirectory $objdir]} {
|
||||
set objdir [file join $origin_url objects]
|
||||
if {![file isdirectory $objdir]} {
|
||||
error_popup [mc "Not a Git repository: %s" [file tail $origin_url]]
|
||||
return
|
||||
}
|
||||
set objdir [_objdir $origin_url]
|
||||
if {$objdir eq {}} {
|
||||
error_popup [mc "Not a Git repository: %s" [file tail $origin_url]]
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -817,6 +995,7 @@ method _do_open {} {
|
||||
pack $w_body.where -fill x
|
||||
|
||||
trace add variable @local_path write [cb _write_local_path]
|
||||
bind $w_body.h <Destroy> [list trace remove variable @local_path write [cb _write_local_path]]
|
||||
update
|
||||
focus $w_body.where.t
|
||||
}
|
||||
@@ -856,6 +1035,7 @@ method _do_open2 {} {
|
||||
return
|
||||
}
|
||||
|
||||
_append_recentrepos [pwd]
|
||||
set ::_gitdir .git
|
||||
set ::_prefix {}
|
||||
set done 1
|
||||
|
||||
@@ -2,28 +2,22 @@
|
||||
# Copyright (C) 2006, 2007 Shawn Pearce
|
||||
|
||||
proc do_windows_shortcut {} {
|
||||
global argv0
|
||||
|
||||
set fn [tk_getSaveFile \
|
||||
-parent . \
|
||||
-title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
|
||||
-initialfile "Git [reponame].bat"]
|
||||
-initialfile "Git [reponame].lnk"]
|
||||
if {$fn != {}} {
|
||||
if {[file extension $fn] ne {.bat}} {
|
||||
set fn ${fn}.bat
|
||||
if {[file extension $fn] ne {.lnk}} {
|
||||
set fn ${fn}.lnk
|
||||
}
|
||||
if {[catch {
|
||||
set ge [file normalize [file dirname $::_git]]
|
||||
set fd [open $fn w]
|
||||
puts $fd "@ECHO Entering [reponame]"
|
||||
puts $fd "@ECHO Starting git-gui... please wait..."
|
||||
puts $fd "@SET PATH=$ge;%PATH%"
|
||||
puts $fd "@SET GIT_DIR=[file normalize [gitdir]]"
|
||||
puts -nonewline $fd "@\"[info nameofexecutable]\""
|
||||
puts $fd " \"[file normalize $argv0]\""
|
||||
close $fd
|
||||
win32_create_lnk $fn [list \
|
||||
[info nameofexecutable] \
|
||||
[file normalize $::argv0] \
|
||||
] \
|
||||
[file dirname [file normalize [gitdir]]]
|
||||
} err]} {
|
||||
error_popup [strcat [mc "Cannot write script:"] "\n\n$err"]
|
||||
error_popup [strcat [mc "Cannot write shortcut:"] "\n\n$err"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,13 +38,12 @@ proc do_cygwin_shortcut {} {
|
||||
-parent . \
|
||||
-title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
|
||||
-initialdir $desktop \
|
||||
-initialfile "Git [reponame].bat"]
|
||||
-initialfile "Git [reponame].lnk"]
|
||||
if {$fn != {}} {
|
||||
if {[file extension $fn] ne {.bat}} {
|
||||
set fn ${fn}.bat
|
||||
if {[file extension $fn] ne {.lnk}} {
|
||||
set fn ${fn}.lnk
|
||||
}
|
||||
if {[catch {
|
||||
set fd [open $fn w]
|
||||
set sh [exec cygpath \
|
||||
--windows \
|
||||
--absolute \
|
||||
@@ -59,19 +52,13 @@ proc do_cygwin_shortcut {} {
|
||||
--unix \
|
||||
--absolute \
|
||||
$argv0]
|
||||
set gd [exec cygpath \
|
||||
--unix \
|
||||
--absolute \
|
||||
[gitdir]]
|
||||
puts $fd "@ECHO Entering [reponame]"
|
||||
puts $fd "@ECHO Starting git-gui... please wait..."
|
||||
puts -nonewline $fd "@\"$sh\" --login -c \""
|
||||
puts -nonewline $fd "GIT_DIR=[sq $gd]"
|
||||
puts -nonewline $fd " [sq $me]"
|
||||
puts $fd " &\""
|
||||
close $fd
|
||||
win32_create_lnk $fn [list \
|
||||
$sh -c \
|
||||
"CHERE_INVOKING=1 source /etc/profile;[sq $me]" \
|
||||
] \
|
||||
[file dirname [file normalize [gitdir]]]
|
||||
} err]} {
|
||||
error_popup [strcat [mc "Cannot write script:"] "\n\n$err"]
|
||||
error_popup [strcat [mc "Cannot write shortcut:"] "\n\n$err"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
26
git-gui/lib/win32.tcl
Normal file
26
git-gui/lib/win32.tcl
Normal file
@@ -0,0 +1,26 @@
|
||||
# git-gui Misc. native Windows 32 support
|
||||
# Copyright (C) 2007 Shawn Pearce
|
||||
|
||||
proc win32_read_lnk {lnk_path} {
|
||||
return [exec cscript.exe \
|
||||
/E:jscript \
|
||||
/nologo \
|
||||
[file join $::oguilib win32_shortcut.js] \
|
||||
$lnk_path]
|
||||
}
|
||||
|
||||
proc win32_create_lnk {lnk_path lnk_exec lnk_dir} {
|
||||
global oguilib
|
||||
|
||||
set lnk_args [lrange $lnk_exec 1 end]
|
||||
set lnk_exec [lindex $lnk_exec 0]
|
||||
|
||||
eval [list exec wscript.exe \
|
||||
/E:jscript \
|
||||
/nologo \
|
||||
[file join $oguilib win32_shortcut.js] \
|
||||
$lnk_path \
|
||||
[file join $oguilib git-gui.ico] \
|
||||
$lnk_dir \
|
||||
$lnk_exec] $lnk_args
|
||||
}
|
||||
34
git-gui/lib/win32_shortcut.js
Normal file
34
git-gui/lib/win32_shortcut.js
Normal file
@@ -0,0 +1,34 @@
|
||||
// git-gui Windows shortcut support
|
||||
// Copyright (C) 2007 Shawn Pearce
|
||||
|
||||
var WshShell = WScript.CreateObject("WScript.Shell");
|
||||
var argv = WScript.Arguments;
|
||||
var argi = 0;
|
||||
var lnk_path = argv.item(argi++);
|
||||
var ico_path = argi < argv.length ? argv.item(argi++) : undefined;
|
||||
var dir_path = argi < argv.length ? argv.item(argi++) : undefined;
|
||||
var lnk_exec = argi < argv.length ? argv.item(argi++) : undefined;
|
||||
var lnk_args = '';
|
||||
while (argi < argv.length) {
|
||||
var s = argv.item(argi++);
|
||||
if (lnk_args != '')
|
||||
lnk_args += ' ';
|
||||
if (s.indexOf(' ') >= 0) {
|
||||
lnk_args += '"';
|
||||
lnk_args += s;
|
||||
lnk_args += '"';
|
||||
} else {
|
||||
lnk_args += s;
|
||||
}
|
||||
}
|
||||
|
||||
var lnk = WshShell.CreateShortcut(lnk_path);
|
||||
if (argv.length == 1) {
|
||||
WScript.echo(lnk.TargetPath);
|
||||
} else {
|
||||
lnk.TargetPath = lnk_exec;
|
||||
lnk.Arguments = lnk_args;
|
||||
lnk.IconLocation = ico_path + ", 0";
|
||||
lnk.WorkingDirectory = dir_path;
|
||||
lnk.Save();
|
||||
}
|
||||
180
git-gui/po/glossary/it.po
Normal file
180
git-gui/po/glossary/it.po
Normal file
@@ -0,0 +1,180 @@
|
||||
# Translation of git-gui glossary to Italian
|
||||
# Copyright (C) 2007 Shawn Pearce, et al.
|
||||
# This file is distributed under the same license as the git package.
|
||||
# Christian Stimming <stimming@tuhh.de>, 2007
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: git-gui glossary\n"
|
||||
"POT-Creation-Date: 2007-10-05 22:30+0200\n"
|
||||
"PO-Revision-Date: 2007-10-10 15:24+0200\n"
|
||||
"Last-Translator: Michele Ballabio <barra_cuda@katamail.com>\n"
|
||||
"Language-Team: Italian \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#. "English Definition (Dear translator: This file will never be visible to the user! It should only serve as a tool for you, the translator. Nothing more.)"
|
||||
msgid ""
|
||||
"English Term (Dear translator: This file will never be visible to the user!)"
|
||||
msgstr ""
|
||||
"Traduzione italiana.\n"
|
||||
"Altri SCM in italiano:\n"
|
||||
" http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/Languages/Tortoise_it."
|
||||
"po (username=guest, password empty),\n"
|
||||
" http://tortoisecvs.cvs.sourceforge.net/tortoisecvs/po/TortoiseCVS/it_IT.po?"
|
||||
"view=markup ,\n"
|
||||
" http://rapidsvn.tigris.org/svn/rapidsvn/trunk/src/locale/it_IT/rapidsvn.po "
|
||||
"(username=guest, password empty)"
|
||||
|
||||
#. ""
|
||||
msgid "amend"
|
||||
msgstr "correggere, correzione"
|
||||
|
||||
#. ""
|
||||
msgid "annotate"
|
||||
msgstr "annotare, annotazione"
|
||||
|
||||
#. "A 'branch' is an active line of development."
|
||||
msgid "branch [noun]"
|
||||
msgstr "ramo, diramazione, ramificazione"
|
||||
|
||||
#. ""
|
||||
msgid "branch [verb]"
|
||||
msgstr "creare ramo, ramificare, diramare"
|
||||
|
||||
#. ""
|
||||
msgid "checkout [noun]"
|
||||
msgstr "attivazione, checkout, revisione attiva, prelievo (TortoiseCVS)?"
|
||||
|
||||
#. "The action of updating the working tree to a revision which was stored in the object database."
|
||||
msgid "checkout [verb]"
|
||||
msgstr ""
|
||||
"attivare, effettuare un checkout, attivare revisione, prelevare (TortoiseCVS), "
|
||||
"ritirare (TSVN)?"
|
||||
|
||||
#. ""
|
||||
msgid "clone [verb]"
|
||||
msgstr "clonare"
|
||||
|
||||
#. "A single point in the git history."
|
||||
msgid "commit [noun]"
|
||||
msgstr "revisione, commit, deposito (TortoiseCVS), invio (TSVN)?"
|
||||
|
||||
#. "The action of storing a new snapshot of the project's state in the git history."
|
||||
msgid "commit [verb]"
|
||||
msgstr ""
|
||||
"creare una nuova revisione, archiviare, effettuare un commit, depositare "
|
||||
"(nel server), fare un deposito (TortoiseCVS), inviare (TSVN)?"
|
||||
|
||||
#. ""
|
||||
msgid "diff [noun]"
|
||||
msgstr "differenza, confronto, comparazione, raffronto"
|
||||
|
||||
#. ""
|
||||
msgid "diff [verb]"
|
||||
msgstr "confronta, mostra le differenze"
|
||||
|
||||
#. "A fast-forward is a special type of merge where you have a revision and you are merging another branch's changes that happen to be a descendant of what you have."
|
||||
msgid "fast forward merge"
|
||||
msgstr "fusione in 'fast-forward', fusione in avanti veloce"
|
||||
|
||||
#. "Fetching a branch means to get the branch's head from a remote repository, to find out which objects are missing from the local object database, and to get them, too."
|
||||
msgid "fetch"
|
||||
msgstr "recuperare, prelevare, prendere da, recuperare (TSVN)"
|
||||
|
||||
#. "A collection of files. The index is a stored version of your working tree."
|
||||
msgid "index (in git-gui: staging area)"
|
||||
msgstr "indice"
|
||||
|
||||
#. "A successful merge results in the creation of a new commit representing the result of the merge."
|
||||
msgid "merge [noun]"
|
||||
msgstr "fusione, unione"
|
||||
|
||||
#. "To bring the contents of another branch into the current branch."
|
||||
msgid "merge [verb]"
|
||||
msgstr "effettuare la fusione, unire, fondere, eseguire la fusione"
|
||||
|
||||
#. ""
|
||||
msgid "message"
|
||||
msgstr "messaggio, commento"
|
||||
|
||||
#. ""
|
||||
msgid "prune"
|
||||
msgstr "potatura"
|
||||
|
||||
#. "Pulling a branch means to fetch it and merge it."
|
||||
msgid "pull"
|
||||
msgstr ""
|
||||
"prendi (recupera) e fondi (unisci)? (in pratica una traduzione di fetch + "
|
||||
"merge)"
|
||||
|
||||
#. "Pushing a branch means to get the branch's head ref from a remote repository, and ... (well, can someone please explain it for mere mortals?)"
|
||||
msgid "push"
|
||||
msgstr "propaga"
|
||||
|
||||
#. ""
|
||||
msgid "redo"
|
||||
msgstr "ripeti, rifai"
|
||||
|
||||
#. "A collection of refs (?) together with an object database containing all objects which are reachable from the refs... (oops, you've lost me here. Again, please an explanation for mere mortals?)"
|
||||
msgid "repository"
|
||||
msgstr "archivio, repository, database? deposito (rapidsvn)?"
|
||||
|
||||
#. ""
|
||||
msgid "reset"
|
||||
msgstr "ripristinare, annullare, azzerare, ripristinare"
|
||||
|
||||
#. ""
|
||||
msgid "revert"
|
||||
msgstr ""
|
||||
"annullare, inverti (rapidsvn), ritorna allo stato precedente, annulla le "
|
||||
"modifiche della revisione"
|
||||
|
||||
#. "A particular state of files and directories which was stored in the object database."
|
||||
msgid "revision"
|
||||
msgstr "revisione (TortoiseSVN)"
|
||||
|
||||
#. ""
|
||||
msgid "sign off"
|
||||
msgstr "sign off, firma"
|
||||
|
||||
#. ""
|
||||
msgid "staging area"
|
||||
msgstr ""
|
||||
"area di preparazione, zona di preparazione, modifiche in preparazione? "
|
||||
"modifiche in allestimento?"
|
||||
|
||||
#. ""
|
||||
msgid "status"
|
||||
msgstr "stato"
|
||||
|
||||
#. "A ref pointing to a tag or commit object"
|
||||
msgid "tag [noun]"
|
||||
msgstr "etichetta, etichettatura (TortoiseCVS)"
|
||||
|
||||
#. ""
|
||||
msgid "tag [verb]"
|
||||
msgstr "etichettare"
|
||||
|
||||
#. "A regular git branch that is used to follow changes from another repository."
|
||||
msgid "tracking branch"
|
||||
msgstr ""
|
||||
"duplicato locale di ramo remoto, ramo in 'tracking', ramo inseguitore? ramo di {inseguimento,allineamento,"
|
||||
"rilevamento,puntamento}?"
|
||||
|
||||
#. ""
|
||||
msgid "undo"
|
||||
msgstr "annulla"
|
||||
|
||||
#. ""
|
||||
msgid "update"
|
||||
msgstr "aggiornamento, aggiornare"
|
||||
|
||||
#. ""
|
||||
msgid "verify"
|
||||
msgstr "verifica, verificare"
|
||||
|
||||
#. "The tree of actual checked out files."
|
||||
msgid "working copy, working tree"
|
||||
msgstr "directory di lavoro, copia di lavoro"
|
||||
493
git-gui/po/it.po
493
git-gui/po/it.po
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user