Skip to content

Commit

Permalink
Merge git://repo.or.cz/git-gui
Browse files Browse the repository at this point in the history
* git://repo.or.cz/git-gui:
  git-gui: update french translation
  git-gui: update Japanese translation
  git-gui: fix shortcut for menu "Commit/Revert Changes"
  git-gui: Quote git path when starting another gui in a submodule
  git-gui: update Italian translation
  git-gui: Update Swedish translation (520t0f0u)
  git-gui: use themed tk widgets with Tk 8.5
  git-gui: Update German translation (12 new or changed strings).
  git-gui: Update translation template
  git-gui: Remove unused icon file_parttick
  git-gui: use different icon for new and modified files in the index
  git-gui: set GIT_DIR and GIT_WORK_TREE after setup
  git-gui: update shortcut tools to use _gitworktree
  git-gui: handle bare repos correctly
  git-gui: handle non-standard worktree locations
  git-gui: Support applying a range of changes at once
  git-gui: Add a special diff popup menu for submodules
  git-gui: Use git diff --submodule when available
  • Loading branch information
Junio C Hamano committed Feb 7, 2010
2 parents e7ec9de + 89d6159 commit 8051a03
Showing 34 changed files with 3,126 additions and 2,514 deletions.
399 changes: 293 additions & 106 deletions git-gui/git-gui.sh

Large diffs are not rendered by default.

37 changes: 10 additions & 27 deletions git-gui/lib/about.tcl
Original file line number Diff line number Diff line change
@@ -4,31 +4,26 @@
proc do_about {} {
global appvers copyright oguilib
global tcl_patchLevel tk_patchLevel
global ui_comm_spell
global ui_comm_spell NS use_ttk

set w .about_dialog
toplevel $w
Dialog $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
${NS}::label $w.header -text [mc "About %s" [appname]] \
-font font_uibold -anchor center
pack $w.header -side top -fill x

frame $w.buttons
button $w.buttons.close -text {Close} \
${NS}::frame $w.buttons
${NS}::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
paddedlabel $w.desc \
-text "[mc "git-gui - a graphical user interface for Git."]\n$copyright"
pack $w.desc -side top -fill x -padx 5 -pady 5

set v {}
@@ -52,22 +47,10 @@ proc do_about {} {
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
paddedlabel $w.vers -text $v
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
paddedlabel $w.dirs -text $d
pack $w.dirs -side top -fill x -padx 5 -pady 5

menu $w.ctxm -tearoff 0
22 changes: 11 additions & 11 deletions git-gui/lib/blame.tcl
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ field tooltip_timer {} ; # Current timer event for our tooltip
field tooltip_commit {} ; # Commit(s) in tooltip

constructor new {i_commit i_path i_jump} {
global cursor_ptr M1B M1T have_tk85
global cursor_ptr M1B M1T have_tk85 use_ttk NS
variable active_color
variable group_colors

@@ -73,15 +73,15 @@ constructor new {i_commit i_path i_jump} {

set font_w [font measure font_diff "0"]

frame $w.header -background gold
label $w.header.commit_l \
gold_frame $w.header
tlabel $w.header.commit_l \
-text [mc "Commit:"] \
-background gold \
-foreground black \
-anchor w \
-justify left
set w_back $w.header.commit_b
label $w_back \
tlabel $w_back \
-image ::blame::img_back_arrow \
-borderwidth 0 \
-relief flat \
@@ -94,20 +94,20 @@ constructor new {i_commit i_path i_jump} {
[cb _history_menu]
}
"
label $w.header.commit \
tlabel $w.header.commit \
-textvariable @commit \
-background gold \
-foreground black \
-anchor w \
-justify left
label $w.header.path_l \
tlabel $w.header.path_l \
-text [mc "File:"] \
-background gold \
-foreground black \
-anchor w \
-justify left
set w_path $w.header.path
label $w_path \
tlabel $w_path \
-background gold \
-foreground black \
-anchor w \
@@ -209,10 +209,10 @@ constructor new {i_commit i_path i_jump} {

set w_columns [list $w_amov $w_asim $w_line $w_file]

scrollbar $w.file_pane.out.sbx \
${NS}::scrollbar $w.file_pane.out.sbx \
-orient h \
-command [list $w_file xview]
scrollbar $w.file_pane.out.sby \
${NS}::scrollbar $w.file_pane.out.sby \
-orient v \
-command [list scrollbar2many $w_columns yview]
eval grid $w_columns $w.file_pane.out.sby -sticky nsew
@@ -254,10 +254,10 @@ constructor new {i_commit i_path i_jump} {
-background $active_color \
-font font_ui
$w_cviewer tag raise sel
scrollbar $w.file_pane.cm.sbx \
${NS}::scrollbar $w.file_pane.cm.sbx \
-orient h \
-command [list $w_cviewer xview]
scrollbar $w.file_pane.cm.sby \
${NS}::scrollbar $w.file_pane.cm.sby \
-orient v \
-command [list $w_cviewer yview]
pack $w.file_pane.cm.sby -side right -fill y
20 changes: 12 additions & 8 deletions git-gui/lib/branch_checkout.tcl
Original file line number Diff line number Diff line change
@@ -10,21 +10,24 @@ field opt_fetch 1; # refetch tracking branch if used?
field opt_detach 0; # force a detached head case?

constructor dialog {} {
make_toplevel top w
global use_ttk NS
make_dialog top w
wm withdraw $w
wm title $top [append "[appname] ([reponame]): " [mc "Checkout Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}

label $w.header -text [mc "Checkout Branch"] -font font_uibold
${NS}::label $w.header -text [mc "Checkout Branch"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x

frame $w.buttons
button $w.buttons.create -text [mc Checkout] \
${NS}::frame $w.buttons
${NS}::button $w.buttons.create -text [mc Checkout] \
-default active \
-command [cb _checkout]
pack $w.buttons.create -side right
button $w.buttons.cancel -text [mc Cancel] \
${NS}::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
@@ -33,14 +36,14 @@ constructor dialog {} {
$w_rev bind_listbox <Double-Button-1> [cb _checkout]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5

labelframe $w.options -text [mc Options]
${NS}::labelframe $w.options -text [mc Options]

checkbutton $w.options.fetch \
${NS}::checkbutton $w.options.fetch \
-text [mc "Fetch Tracking Branch"] \
-variable @opt_fetch
pack $w.options.fetch -anchor nw

checkbutton $w.options.detach \
${NS}::checkbutton $w.options.detach \
-text [mc "Detach From Local Branch"] \
-variable @opt_detach
pack $w.options.detach -anchor nw
@@ -50,6 +53,7 @@ constructor dialog {} {
bind $w <Visibility> [cb _visible]
bind $w <Key-Escape> [list destroy $w]
bind $w <Key-Return> [cb _checkout]\;break
wm deiconify $w
tkwait window $w
}

45 changes: 23 additions & 22 deletions git-gui/lib/branch_create.tcl
Original file line number Diff line number Diff line change
@@ -16,48 +16,48 @@ field opt_fetch 1; # refetch tracking branch if used?
field reset_ok 0; # did the user agree to reset?

constructor dialog {} {
global repo_config
global repo_config use_ttk NS

make_toplevel top w
make_dialog top w
wm withdraw $w
wm title $top [append "[appname] ([reponame]): " [mc "Create Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}

label $w.header -text [mc "Create New Branch"] -font font_uibold
${NS}::label $w.header -text [mc "Create New Branch"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x

frame $w.buttons
button $w.buttons.create -text [mc Create] \
${NS}::frame $w.buttons
${NS}::button $w.buttons.create -text [mc Create] \
-default active \
-command [cb _create]
pack $w.buttons.create -side right
button $w.buttons.cancel -text [mc Cancel] \
${NS}::button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10

labelframe $w.desc -text [mc "Branch Name"]
radiobutton $w.desc.name_r \
-anchor w \
${NS}::labelframe $w.desc -text [mc "Branch Name"]
${NS}::radiobutton $w.desc.name_r \
-text [mc "Name:"] \
-value user \
-variable @name_type
if {!$use_ttk} {$w.desc.name_r configure -anchor w}
set w_name $w.desc.name_t
entry $w_name \
-borderwidth 1 \
-relief sunken \
${NS}::entry $w_name \
-width 40 \
-textvariable @name \
-validate key \
-validatecommand [cb _validate %d %S]
grid $w.desc.name_r $w_name -sticky we -padx {0 5}

radiobutton $w.desc.match_r \
-anchor w \
${NS}::radiobutton $w.desc.match_r \
-text [mc "Match Tracking Branch Name"] \
-value match \
-variable @name_type
if {!$use_ttk} {$w.desc.match_r configure -anchor w}
grid $w.desc.match_r -sticky we -padx {0 5} -columnspan 2

grid columnconfigure $w.desc 1 -weight 1
@@ -66,34 +66,34 @@ constructor dialog {} {
set w_rev [::choose_rev::new $w.rev [mc "Starting Revision"]]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5

labelframe $w.options -text [mc Options]
${NS}::labelframe $w.options -text [mc Options]

frame $w.options.merge
label $w.options.merge.l -text [mc "Update Existing Branch:"]
${NS}::frame $w.options.merge
${NS}::label $w.options.merge.l -text [mc "Update Existing Branch:"]
pack $w.options.merge.l -side left
radiobutton $w.options.merge.no \
${NS}::radiobutton $w.options.merge.no \
-text [mc No] \
-value none \
-variable @opt_merge
pack $w.options.merge.no -side left
radiobutton $w.options.merge.ff \
${NS}::radiobutton $w.options.merge.ff \
-text [mc "Fast Forward Only"] \
-value ff \
-variable @opt_merge
pack $w.options.merge.ff -side left
radiobutton $w.options.merge.reset \
${NS}::radiobutton $w.options.merge.reset \
-text [mc Reset] \
-value reset \
-variable @opt_merge
pack $w.options.merge.reset -side left
pack $w.options.merge -anchor nw

checkbutton $w.options.fetch \
${NS}::checkbutton $w.options.fetch \
-text [mc "Fetch Tracking Branch"] \
-variable @opt_fetch
pack $w.options.fetch -anchor nw

checkbutton $w.options.checkout \
${NS}::checkbutton $w.options.checkout \
-text [mc "Checkout After Creation"] \
-variable @opt_checkout
pack $w.options.checkout -anchor nw
@@ -109,6 +109,7 @@ constructor dialog {} {
bind $w <Visibility> [cb _visible]
bind $w <Key-Escape> [list destroy $w]
bind $w <Key-Return> [cb _create]\;break
wm deiconify $w
tkwait window $w
}

24 changes: 12 additions & 12 deletions git-gui/lib/branch_delete.tcl
Original file line number Diff line number Diff line change
@@ -9,41 +9,40 @@ field w_check ; # revision picker for merge test
field w_delete ; # delete button

constructor dialog {} {
global current_branch
global current_branch use_ttk NS

make_toplevel top w
make_dialog top w
wm withdraw $w
wm title $top [append "[appname] ([reponame]): " [mc "Delete Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}

label $w.header -text [mc "Delete Local Branch"] -font font_uibold
${NS}::label $w.header -text [mc "Delete Local Branch"] \
-font font_uibold -anchor center
pack $w.header -side top -fill x

frame $w.buttons
${NS}::frame $w.buttons
set w_delete $w.buttons.delete
button $w_delete \
${NS}::button $w_delete \
-text [mc Delete] \
-default active \
-state disabled \
-command [cb _delete]
pack $w_delete -side right
button $w.buttons.cancel \
${NS}::button $w.buttons.cancel \
-text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10

labelframe $w.list -text [mc "Local Branches"]
${NS}::labelframe $w.list -text [mc "Local Branches"]
set w_heads $w.list.l
listbox $w_heads \
slistbox $w_heads \
-height 10 \
-width 70 \
-selectmode extended \
-exportselection false \
-yscrollcommand [list $w.list.sby set]
scrollbar $w.list.sby -command [list $w.list.l yview]
pack $w.list.sby -side right -fill y
-exportselection false
pack $w.list.l -side left -fill both -expand 1
pack $w.list -fill both -expand 1 -pady 5 -padx 5

@@ -67,6 +66,7 @@ constructor dialog {} {
"
bind $w <Key-Escape> [list destroy $w]
bind $w <Key-Return> [cb _delete]\;break
wm deiconify $w
tkwait window $w
}

Loading

0 comments on commit 8051a03

Please sign in to comment.