Merge commit 'git-gui/master' into for/win

This commit is contained in:
Steffen Prohaska
2007-10-10 20:43:10 +02:00
19 changed files with 5184 additions and 1891 deletions

View File

@@ -126,6 +126,10 @@ ifeq ($(uname_S),Darwin)
GITGUI_MACOSXAPP := YesPlease
endif
endif
ifneq (,$(findstring MINGW,$(uname_S)))
NO_MSGFMT=1
GITGUI_WINDOWS_WRAPPER := YesPlease
endif
ifdef GITGUI_MACOSXAPP
GITGUI_MAIN := git-gui.tcl
@@ -165,6 +169,13 @@ Git\ Gui.app: GIT-VERSION-FILE GIT-GUI-VARS \
mv '$@'+ '$@'
endif
ifdef GITGUI_WINDOWS_WRAPPER
GITGUI_MAIN := git-gui.tcl
git-gui: windows/git-gui.sh
cp $< $@
endif
$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-VARS
$(QUIET_GEN)rm -f $@ $@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
@@ -230,12 +241,18 @@ GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
ifdef GITGUI_MACOSXAPP
all:: git-gui Git\ Gui.app
endif
ifdef GITGUI_WINDOWS_WRAPPER
all:: git-gui
endif
all:: $(GITGUI_MAIN) lib/tclIndex $(ALL_MSGFILES)
install: all
$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
$(QUIET)$(INSTALL_X0)git-gui $(INSTALL_X1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
$(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(INSTALL_L0)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L1)'$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' $(INSTALL_L2)'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' $(INSTALL_L3) &&) true
ifdef GITGUI_WINDOWS_WRAPPER
$(QUIET)$(INSTALL_R0)git-gui.tcl $(INSTALL_R1) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
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)'
@@ -251,6 +268,9 @@ uninstall:
$(QUIET)$(CLEAN_DST) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui $(REMOVE_F1)
$(QUIET)$(foreach p,$(GITGUI_BUILT_INS), $(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/$p $(REMOVE_F1) &&) true
ifdef GITGUI_WINDOWS_WRAPPER
$(QUIET)$(REMOVE_F0)'$(DESTDIR_SQ)$(gitexecdir_SQ)'/git-gui.tcl $(REMOVE_F1)
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)
@@ -276,6 +296,9 @@ clean::
ifdef GITGUI_MACOSXAPP
$(RM_RF) 'Git Gui.app'* git-gui
endif
ifdef GITGUI_WINDOWS_WRAPPER
$(RM_RF) git-gui
endif
.PHONY: all install uninstall dist-version clean
.PHONY: .FORCE-GIT-VERSION-FILE

File diff suppressed because it is too large Load Diff

View File

@@ -343,6 +343,9 @@ proc _which {what} {
$env(PATH)] {;}]
set _search_exe .exe
} elseif {[is_Windows]} {
set gitguidir [file dirname [info script]]
regsub -all ";" $gitguidir "\\;" gitguidir
set env(PATH) "$gitguidir;$env(PATH)"
set _search_path [split $env(PATH) {;}]
set _search_exe .exe
} else {
@@ -665,6 +668,7 @@ regsub -- {-dirty$} $_git_version {} _git_version
regsub {\.[0-9]+\.g[0-9a-f]+$} $_git_version {} _git_version
regsub {\.rc[0-9]+$} $_git_version {} _git_version
regsub {\.GIT$} $_git_version {} _git_version
regsub {\.[a-zA-Z]+\.[0-9]+$} $_git_version {} _git_version
if {![regexp {^[1-9]+(\.[0-9]+)+$} $_git_version]} {
catch {wm withdraw .}
@@ -1791,8 +1795,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
}
if {[is_enabled transport]} {
.mbar add cascade -label [mc Merge] -menu .mbar.merge
.mbar add cascade -label [mc Fetch] -menu .mbar.fetch
.mbar add cascade -label [mc Push] -menu .mbar.push
.mbar add cascade -label [mc Remote] -menu .mbar.remote
}
. configure -menu .mbar
@@ -1999,13 +2002,14 @@ if {[is_enabled branch]} {
# -- Transport Menu
#
if {[is_enabled transport]} {
menu .mbar.fetch
menu .mbar.remote
menu .mbar.push
.mbar.push add command -label [mc "Push..."] \
.mbar.remote add command \
-label [mc "Push..."] \
-command do_push_anywhere \
-accelerator $M1T-P
.mbar.push add command -label [mc "Delete..."] \
.mbar.remote add command \
-label [mc "Delete..."] \
-command remote_branch_delete::dialog
}
@@ -2017,8 +2021,12 @@ if {[is_MacOSX]} {
.mbar.apple add command -label [mc "About %s" [appname]] \
-command do_about
.mbar.apple add command -label [mc "Options..."] \
-command do_options
.mbar.apple add separator
.mbar.apple add command \
-label [mc "Preferences..."] \
-command do_options \
-accelerator $M1T-,
bind . <$M1B-,> do_options
} else {
# -- Edit Menu
#
@@ -2208,7 +2216,7 @@ pack .vpane -anchor n -side top -fill both -expand 1
# -- Index File List
#
frame .vpane.files.index -height 100 -width 200
label .vpane.files.index.title -text [mc "Staged Changes (Will Be Committed)"] \
label .vpane.files.index.title -text [mc "Staged Changes (Will Commit)"] \
-background lightgreen
text $ui_index -background white -borderwidth 0 \
-width 20 -height 10 \
@@ -2228,7 +2236,7 @@ pack $ui_index -side left -fill both -expand 1
# -- Working Directory File List
#
frame .vpane.files.workdir -height 100 -width 200
label .vpane.files.workdir.title -text [mc "Unstaged Changes (Will Not Be Committed)"] \
label .vpane.files.workdir.title -text [mc "Unstaged Changes"] \
-background lightsalmon
text $ui_workdir -background white -borderwidth 0 \
-width 20 -height 10 \
@@ -2719,8 +2727,14 @@ user.email settings into your personal
if {[is_enabled transport]} {
load_all_remotes
populate_fetch_menu
set n [.mbar.remote index end]
populate_push_menu
populate_fetch_menu
set n [expr {[.mbar.remote index end] - $n}]
if {$n > 0} {
.mbar.remote insert $n separator
}
unset n
}
if {[winfo exists $ui_comm]} {

View File

@@ -6,7 +6,8 @@
msgid ""
msgstr ""
"Project-Id-Version: git-gui glossary\n"
"PO-Revision-Date: 2007-07-26 14:45+0200\n"
"POT-Creation-Date: 2007-10-05 22:30+0200\n"
"PO-Revision-Date: 2007-10-05 22:32+0200\n"
"Last-Translator: Christian Stimming <stimming@tuhh.de>\n"
"Language-Team: German \n"
"MIME-Version: 1.0\n"
@@ -19,11 +20,17 @@ msgid ""
msgstr ""
"Deutsche Übersetzung.\n"
"Andere deutsche SCM:\n"
" http://tortoisesvn.net/docs/release/TortoiseSVN_de/index.html und http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/Languages/Tortoise_de.po (username=guest, password empty, gut),\n"
" http://msdn.microsoft.com/de-de/library/ms181038(vs.80).aspx (MS Visual Source Safe, kommerziell),\n"
" http://cvsbook.red-bean.com/translations/german/Kap_06.html (mittelmäßig),\n"
" http://tortoisecvs.cvs.sourceforge.net/tortoisecvs/po/TortoiseCVS/de_DE.po?view=markup (mittelmäßig),\n"
" http://rapidsvn.tigris.org/svn/rapidsvn/trunk/src/locale/de/rapidsvn.po (username=guest, password empty, schlecht)"
" http://tortoisesvn.net/docs/release/TortoiseSVN_de/index.html und http://"
"tortoisesvn.tigris.org/svn/tortoisesvn/trunk/Languages/Tortoise_de.po "
"(username=guest, password empty, gut),\n"
" http://msdn.microsoft.com/de-de/library/ms181038(vs.80).aspx (MS Visual "
"Source Safe, kommerziell),\n"
" http://cvsbook.red-bean.com/translations/german/Kap_06.html "
"(mittelmäßig),\n"
" http://tortoisecvs.cvs.sourceforge.net/tortoisecvs/po/TortoiseCVS/de_DE.po?"
"view=markup (mittelmäßig),\n"
" http://rapidsvn.tigris.org/svn/rapidsvn/trunk/src/locale/de/rapidsvn.po "
"(username=guest, password empty, schlecht)"
#. ""
msgid "amend"
@@ -43,19 +50,31 @@ msgstr "verzweigen"
#. ""
msgid "checkout [noun]"
msgstr "Auscheck? Ausspielung? Abruf? (Source Safe: Auscheckvorgang)"
msgstr ""
"Arbeitskopie (Erstellung einer Arbeitskopie; Auscheck? Ausspielung? Abruf? "
"Source Safe: Auscheckvorgang)"
#. "The action of updating the working tree to a revision which was stored in the object database."
msgid "checkout [verb]"
msgstr "auschecken? ausspielen? abrufen? (Source Safe: auschecken)"
msgstr ""
"Arbeitskopie erstellen; Zweig umstellen [checkout a branch] (auschecken? "
"ausspielen? abrufen? Source Safe: auschecken)"
#. ""
msgid "clone [verb]"
msgstr "kopieren"
#. "A single point in the git history."
msgid "commit [noun]"
msgstr "Übertragung (Sendung?, Übergabe?, Einspielung?, Ablagevorgang?)"
msgstr ""
"Version; Eintragung; Änderung (Buchung?, Eintragung?, Übertragung?, "
"Sendung?, Übergabe?, Einspielung?, Ablagevorgang?)"
#. "The action of storing a new snapshot of the project's state in the git history."
msgid "commit [verb]"
msgstr "übertragen (TortoiseSVN: übertragen; Source Safe: einchecken; senden?, übergeben?, einspielen?, einpflegen?, ablegen?)"
msgstr ""
"eintragen (TortoiseSVN: übertragen; Source Safe: einchecken; senden?, "
"übergeben?, einspielen?, einpflegen?, ablegen?)"
#. ""
msgid "diff [noun]"
@@ -87,7 +106,11 @@ msgstr "zusammenführen"
#. ""
msgid "message"
msgstr "Meldung (Nachricht?; Source Safe: Kommentar)"
msgstr "Beschreibung (Meldung?, Nachricht?; Source Safe: Kommentar)"
#. ""
msgid "prune"
msgstr "löschen"
#. "Pulling a branch means to fetch it and merge it."
msgid "pull"

View File

@@ -6,12 +6,12 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2007-07-27 19:21+0200\n"
"POT-Creation-Date: 2007-10-05 22:30+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\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.)"
@@ -42,6 +42,10 @@ msgstr ""
msgid "checkout [verb]"
msgstr ""
#. ""
msgid "clone [verb]"
msgstr ""
#. "A single point in the git history."
msgid "commit [noun]"
msgstr ""
@@ -82,6 +86,10 @@ msgstr ""
msgid "message"
msgstr ""
#. ""
msgid "prune"
msgstr ""
#. "Pulling a branch means to fetch it and merge it."
msgid "pull"
msgstr ""

View File

@@ -5,6 +5,7 @@
"branch [verb]" ""
"checkout [noun]" ""
"checkout [verb]" "The action of updating the working tree to a revision which was stored in the object database."
"clone [verb]" ""
"commit [noun]" "A single point in the git history."
"commit [verb]" "The action of storing a new snapshot of the project's state in the git history."
"diff [noun]" ""
@@ -15,6 +16,7 @@
"merge [noun]" "A successful merge results in the creation of a new commit representing the result of the merge."
"merge [verb]" "To bring the contents of another branch into the current branch."
"message" ""
"prune" ""
"pull" "Pulling a branch means to fetch it and merge it."
"push" "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?)"
"redo" ""

81
git-gui/lib/about.tcl Normal file
View File

@@ -0,0 +1,81 @@
# git-gui about git-gui dialog
# Copyright (C) 2006, 2007 Shawn Pearce
proc do_about {} {
global appvers copyright oguilib
global tcl_patchLevel tk_patchLevel
set w .about_dialog
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
pack [git_logo $w.git_logo] -side left -fill y -padx 10 -pady 10
label $w.header -text [mc "About %s" [appname]] \
-font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.close -text {Close} \
-default active \
-command [list destroy $w]
pack $w.buttons.close -side right
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
label $w.desc \
-text "[mc "git-gui - a graphical user interface for Git."]\n$copyright" \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid
pack $w.desc -side top -fill x -padx 5 -pady 5
set v {}
append v "git-gui version $appvers\n"
append v "[git version]\n"
append v "\n"
if {$tcl_patchLevel eq $tk_patchLevel} {
append v "Tcl/Tk version $tcl_patchLevel"
} else {
append v "Tcl version $tcl_patchLevel"
append v ", Tk version $tk_patchLevel"
}
set d {}
append d "git wrapper: $::_git\n"
append d "git exec dir: [gitexec]\n"
append d "git-gui lib: $oguilib"
label $w.vers \
-text $v \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid
pack $w.vers -side top -fill x -padx 5 -pady 5
label $w.dirs \
-text $d \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid
pack $w.dirs -side top -fill x -padx 5 -pady 5
menu $w.ctxm -tearoff 0
$w.ctxm add command \
-label {Copy} \
-command "
clipboard clear
clipboard append -format STRING -type STRING -- \[$w.vers cget -text\]
"
bind $w <Visibility> "grab $w; focus $w.buttons.close"
bind $w <Key-Escape> "destroy $w"
bind $w <Key-Return> "destroy $w"
bind_button3 $w.vers "tk_popup $w.ctxm %X %Y; grab $w; focus $w"
wm title $w "About [appname]"
tkwait window $w
}

View File

@@ -3,38 +3,6 @@
class choose_repository {
# Henrik Nyh's alternative Git logo, from his blog post
# http://henrik.nyh.se/2007/06/alternative-git-logo-and-favicon
#
image create photo ::choose_repository::git_logo -data {
R0lGODdhYQC8AIQbAGZmZtg4LW9vb3l5eYKCgoyMjEC/TOJpYZWVlZ+fn2/PeK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QE
aOpCrSYAqeMJpEKYqw7ABnsmfwQ8aCwPySqLYKUb/kwAYbPQyoiCtQcOUMKHBwrgK7LaogBuuaxC
OkS0KEwa37EiLBufALPuwO4Jh/InwAixkknEvSe4C9+p3PY3rr3lpnDufguIcCmzRQAc7IHYLhxf
w/8mnILA74lg8cARa4xCsZxusMCBomZccgsfv0deuh2HvLKh/sLs3hJSvieuCwUzvIHN4tGXc3ih
vtDzmj8fSNLR8BWQdH9LH+g00OFF3d/UBx4cUcvuOc21eFRiouV+Xvvr0dDvlX21R/2uzTR89TqU
L3+5UoBgAxtRHd5/CHpLkd13i4D2e3hHRLKMY+9Hr0Nvx/fq3Pw57cng7/m9wQVObnIyhAiQwHF8
/tQS8nDgI2wOYeh3CAvhuIBHiDEgqvdtwudkaz3GBPKaTcKuGgqAJRMZmK6h1hnk3ncDcUvhgPFS
o5B476ZKQcECzCN4qgmYN4lAncmzcAEEkhJp+QlfkyhAAdtbN8H67FvHQAF6b4g6v9UryqfkKkBu
v/0prxD//kR63YnqB8AeqcdoBRxU/1zAuwRaaX4reJ4DSSRAHUhwgrgqwgUx2B94EWGDHISPBzUY
QgSNcAn6K6F4fscDCtBOhdoRwPW6kIHDwZA7vWoDBF44Qd/tIUAEBCACbIeG4AXxfmFrQ4B4OCYE
JBEQELChmgbAACJioj4JOCKCCLCABZ6EAg1IHwDlyLYAB1gRJhSYgHUQAD9WnQ9+CWBAA+wknTpC
JwQAOw==
}
field top
field w
field w_body ; # Widget holding the center content
@@ -92,12 +60,7 @@ constructor pick {} {
bind $top <Key-Escape> [list destroy $top]
}
label $w.git_logo \
-borderwidth 1 \
-relief sunken \
-background white \
-image ::choose_repository::git_logo
pack $w.git_logo -side left -fill y -padx 10 -pady 10
pack [git_logo $w.git_logo] -side left -fill y -padx 10 -pady 10
set w_body $w.body
frame $w_body

View File

@@ -12,12 +12,7 @@ proc update_indexinfo {msg pathList after} {
set batch [expr {int($totalCnt * .01) + 1}]
if {$batch > 25} {set batch 25}
ui_status [format \
"%s... %i/%i files (%.2f%%)" \
$msg \
$update_index_cp \
$totalCnt \
0.0]
$::main_status start $msg [mc "files"]
set fd [git_write update-index -z --index-info]
fconfigure $fd \
-blocking 0 \
@@ -31,18 +26,18 @@ proc update_indexinfo {msg pathList after} {
$pathList \
$totalCnt \
$batch \
$msg \
$after \
]
}
proc write_update_indexinfo {fd pathList totalCnt batch msg after} {
proc write_update_indexinfo {fd pathList totalCnt batch after} {
global update_index_cp
global file_states current_diff_path
if {$update_index_cp >= $totalCnt} {
close $fd
unlock_index
$::main_status stop
uplevel #0 $after
return
}
@@ -68,12 +63,7 @@ proc write_update_indexinfo {fd pathList totalCnt batch msg after} {
display_file $path $new
}
ui_status [format \
"%s... %i/%i files (%.2f%%)" \
$msg \
$update_index_cp \
$totalCnt \
[expr {100.0 * $update_index_cp / $totalCnt}]]
$::main_status update $update_index_cp $totalCnt
}
proc update_index {msg pathList after} {
@@ -87,12 +77,7 @@ proc update_index {msg pathList after} {
set batch [expr {int($totalCnt * .01) + 1}]
if {$batch > 25} {set batch 25}
ui_status [format \
"%s... %i/%i files (%.2f%%)" \
$msg \
$update_index_cp \
$totalCnt \
0.0]
$::main_status start $msg [mc "files"]
set fd [git_write update-index --add --remove -z --stdin]
fconfigure $fd \
-blocking 0 \
@@ -106,18 +91,18 @@ proc update_index {msg pathList after} {
$pathList \
$totalCnt \
$batch \
$msg \
$after \
]
}
proc write_update_index {fd pathList totalCnt batch msg after} {
proc write_update_index {fd pathList totalCnt batch after} {
global update_index_cp
global file_states current_diff_path
if {$update_index_cp >= $totalCnt} {
close $fd
unlock_index
$::main_status stop
uplevel #0 $after
return
}
@@ -147,12 +132,7 @@ proc write_update_index {fd pathList totalCnt batch msg after} {
display_file $path $new
}
ui_status [format \
"%s... %i/%i files (%.2f%%)" \
$msg \
$update_index_cp \
$totalCnt \
[expr {100.0 * $update_index_cp / $totalCnt}]]
$::main_status update $update_index_cp $totalCnt
}
proc checkout_index {msg pathList after} {
@@ -166,12 +146,7 @@ proc checkout_index {msg pathList after} {
set batch [expr {int($totalCnt * .01) + 1}]
if {$batch > 25} {set batch 25}
ui_status [format \
"%s... %i/%i files (%.2f%%)" \
$msg \
$update_index_cp \
$totalCnt \
0.0]
$::main_status start $msg [mc "files"]
set fd [git_write checkout-index \
--index \
--quiet \
@@ -191,18 +166,18 @@ proc checkout_index {msg pathList after} {
$pathList \
$totalCnt \
$batch \
$msg \
$after \
]
}
proc write_checkout_index {fd pathList totalCnt batch msg after} {
proc write_checkout_index {fd pathList totalCnt batch after} {
global update_index_cp
global file_states current_diff_path
if {$update_index_cp >= $totalCnt} {
close $fd
unlock_index
$::main_status stop
uplevel #0 $after
return
}
@@ -222,12 +197,7 @@ proc write_checkout_index {fd pathList totalCnt batch msg after} {
}
}
ui_status [format \
"%s... %i/%i files (%.2f%%)" \
$msg \
$update_index_cp \
$totalCnt \
[expr {100.0 * $update_index_cp / $totalCnt}]]
$::main_status update $update_index_cp $totalCnt
}
proc unstage_helper {txt paths} {

43
git-gui/lib/logo.tcl Normal file
View File

@@ -0,0 +1,43 @@
# git-gui Git Gui logo
# Copyright (C) 2007 Shawn Pearce
# Henrik Nyh's alternative Git logo, from his blog post
# http://henrik.nyh.se/2007/06/alternative-git-logo-and-favicon
#
image create photo ::git_logo_data -data {
R0lGODdhYQC8AIQbAGZmZtg4LW9vb3l5eYKCgoyMjEC/TOJpYZWVlZ+fn2/PeKmpqbKysry8vMXF
xZ/fpc/Pz7fnvPXNytnZ2eLi4s/v0vja1+zs7Of36fX19f3z8v///////////////////ywAAAAA
YQC8AAAF/uAmjmRpnmiqrmzrvq4hz3RtGw+s7zx5/7dcb0hUAY8zYXHJRCKVzGjPeYRKry8q0Irt
GrVBr3gFDo/PprKNix6ra+y2902Ly7H05L2dl9n3UX04gGeCf4RFhohiiotdjY5XkJGBfYeUOpOY
iZablXmXURgPpKWmp6ipqYIKqq6vqREjFYK1trUKs7e7vFq5IrS9wsM0vxvBxMm8xsjKzqy6z9J5
z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5UoBgAxtRHd5/CHpLkd13i4D2e3hHRLKMY+9Hr0Nvx/fq3Pw57cng7/m9wQVObnIyhAiQwHF8
/tQS8nDgI2wOYeh3CAvhuIBHiDEgqvdtwudkaz3GBPKaTcKuGgqAJRMZmK6h1hnk3ncDcUvhgPFS
o5B476ZKQcECzCN4qgmYN4lAncmzcAEEkhJp+QlfkyhAAdtbN8H67FvHQAF6b4g6v9UryqfkKkBu
v/0prxD//kR63YnqB8AeqcdoBRxU/1zAuwRaaX4reJ4DSSRAHUhwgrgqwgUx2B94EWGDHISPBzUY
QgSNcAn6K6F4fscDCtBOhdoRwPW6kIHDwZA7vWoDBF44Qd/tIUAEBCACbIeG4AXxfmFrQ4B4OCYE
JBEQELChmgbAACJioj4JOCKCCLCABZ6EAg1IHwDlyLYAB1gRJhSYgHUQAD9WnQ9+CWBAA+wknTpC
JwQAOw==
}
proc git_logo {w} {
label $w \
-borderwidth 1 \
-relief sunken \
-background white \
-image ::git_logo_data
return $w
}

View File

@@ -54,84 +54,6 @@ proc save_config {} {
}
}
proc do_about {} {
global appvers copyright oguilib
global tcl_patchLevel tk_patchLevel
set w .about_dialog
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
label $w.header -text [mc "About %s" [appname]] \
-font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.close -text {Close} \
-default active \
-command [list destroy $w]
pack $w.buttons.close -side right
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
label $w.desc \
-text "[mc "git-gui - a graphical user interface for Git."]\n$copyright" \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid
pack $w.desc -side top -fill x -padx 5 -pady 5
set v {}
append v "git-gui version $appvers\n"
append v "[git version]\n"
append v "\n"
if {$tcl_patchLevel eq $tk_patchLevel} {
append v "Tcl/Tk version $tcl_patchLevel"
} else {
append v "Tcl version $tcl_patchLevel"
append v ", Tk version $tk_patchLevel"
}
set d {}
append d "git wrapper: $::_git\n"
append d "git exec dir: [gitexec]\n"
append d "git-gui lib: $oguilib"
label $w.vers \
-text $v \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid
pack $w.vers -side top -fill x -padx 5 -pady 5
label $w.dirs \
-text $d \
-padx 5 -pady 5 \
-justify left \
-anchor w \
-borderwidth 1 \
-relief solid
pack $w.dirs -side top -fill x -padx 5 -pady 5
menu $w.ctxm -tearoff 0
$w.ctxm add command \
-label {Copy} \
-command "
clipboard clear
clipboard append -format STRING -type STRING -- \[$w.vers cget -text\]
"
bind $w <Visibility> "grab $w; focus $w.buttons.close"
bind $w <Key-Escape> "destroy $w"
bind $w <Key-Return> "destroy $w"
bind_button3 $w.vers "tk_popup $w.ctxm %X %Y; grab $w; focus $w"
wm title $w "About [appname]"
tkwait window $w
}
proc do_options {} {
global repo_config global_config font_descs
global repo_config_new global_config_new
@@ -156,10 +78,6 @@ proc do_options {} {
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
label $w.header -text [mc "Options"] \
-font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.restore -text [mc "Restore Defaults"] \
-default normal \
@@ -277,7 +195,13 @@ proc do_options {} {
bind $w <Visibility> "grab $w; focus $w.buttons.save"
bind $w <Key-Escape> "destroy $w"
bind $w <Key-Return> [list do_save_config $w]
wm title $w [append "[appname] ([reponame]): " [mc "Options"]]
if {[is_MacOSX]} {
set t [mc "Preferences"]
} else {
set t [mc "Options"]
}
wm title $w "[appname] ([reponame]): $t"
tkwait window $w
}

View File

@@ -135,8 +135,10 @@ proc load_all_remotes {} {
proc populate_fetch_menu {} {
global all_remotes repo_config
set m .mbar.fetch
set prune_list [list]
set remote_m .mbar.remote
set fetch_m $remote_m.fetch
set prune_m $remote_m.prune
foreach r $all_remotes {
set enable 0
if {![catch {set a $repo_config(remote.$r.url)}]} {
@@ -157,28 +159,34 @@ proc populate_fetch_menu {} {
}
if {$enable} {
lappend prune_list $r
$m add command \
-label [mc "Fetch from %s" $r] \
-command [list fetch_from $r]
}
}
if {![winfo exists $fetch_m]} {
menu $prune_m
$remote_m insert 0 cascade \
-label [mc "Prune from"] \
-menu $prune_m
if {$prune_list ne {}} {
$m add separator
}
foreach r $prune_list {
$m add command \
-label [mc "Prune from %s" $r] \
-command [list prune_from $r]
menu $fetch_m
$remote_m insert 0 cascade \
-label [mc "Fetch from"] \
-menu $fetch_m
}
$fetch_m add command \
-label $r \
-command [list fetch_from $r]
$prune_m add command \
-label $r \
-command [list prune_from $r]
}
}
}
proc populate_push_menu {} {
global all_remotes repo_config
set m .mbar.push
set fast_count 0
set remote_m .mbar.remote
set push_m $remote_m.push
foreach r $all_remotes {
set enable 0
if {![catch {set a $repo_config(remote.$r.url)}]} {
@@ -199,13 +207,16 @@ proc populate_push_menu {} {
}
if {$enable} {
if {!$fast_count} {
$m add separator
if {![winfo exists $push_m]} {
menu $push_m
$remote_m insert 0 cascade \
-label [mc "Push to"] \
-menu $push_m
}
$m add command \
-label [mc "Push to %s" $r] \
$push_m add command \
-label $r \
-command [list push_to $r]
incr fast_count
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
#!/bin/sh
# Tcl ignores the next line -*- tcl -*- \
exec wish "$0" -- "$@"
if { $argc >=2 && [lindex $argv 0] == "--working-dir" } {
cd [lindex $argv 1]
set argv [lrange $argv 2 end]
incr argc -2
}
set gitguidir [file dirname [info script]]
regsub -all ";" $gitguidir "\\;" gitguidir
set env(PATH) "$gitguidir;$env(PATH)"
unset gitguidir
source [file join [file dirname [info script]] git-gui.tcl]