Skip to content

Commit 8051a03

Browse files
committed
Merge git://repo.or.cz/git-gui
* 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
2 parents e7ec9de + 89d6159 commit 8051a03

34 files changed

+3126
-2514
lines changed

git-gui/git-gui.sh

Lines changed: 293 additions & 106 deletions
Large diffs are not rendered by default.

git-gui/lib/about.tcl

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,26 @@
44
proc do_about {} {
55
global appvers copyright oguilib
66
global tcl_patchLevel tk_patchLevel
7-
global ui_comm_spell
7+
global ui_comm_spell NS use_ttk
88

99
set w .about_dialog
10-
toplevel $w
10+
Dialog $w
1111
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
1212

1313
pack [git_logo $w.git_logo] -side left -fill y -padx 10 -pady 10
14-
label $w.header -text [mc "About %s" [appname]] \
15-
-font font_uibold
14+
${NS}::label $w.header -text [mc "About %s" [appname]] \
15+
-font font_uibold -anchor center
1616
pack $w.header -side top -fill x
1717

18-
frame $w.buttons
19-
button $w.buttons.close -text {Close} \
18+
${NS}::frame $w.buttons
19+
${NS}::button $w.buttons.close -text {Close} \
2020
-default active \
2121
-command [list destroy $w]
2222
pack $w.buttons.close -side right
2323
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
2424

25-
label $w.desc \
26-
-text "[mc "git-gui - a graphical user interface for Git."]\n$copyright" \
27-
-padx 5 -pady 5 \
28-
-justify left \
29-
-anchor w \
30-
-borderwidth 1 \
31-
-relief solid
25+
paddedlabel $w.desc \
26+
-text "[mc "git-gui - a graphical user interface for Git."]\n$copyright"
3227
pack $w.desc -side top -fill x -padx 5 -pady 5
3328

3429
set v {}
@@ -52,22 +47,10 @@ proc do_about {} {
5247
append d "git exec dir: [gitexec]\n"
5348
append d "git-gui lib: $oguilib"
5449

55-
label $w.vers \
56-
-text $v \
57-
-padx 5 -pady 5 \
58-
-justify left \
59-
-anchor w \
60-
-borderwidth 1 \
61-
-relief solid
50+
paddedlabel $w.vers -text $v
6251
pack $w.vers -side top -fill x -padx 5 -pady 5
6352

64-
label $w.dirs \
65-
-text $d \
66-
-padx 5 -pady 5 \
67-
-justify left \
68-
-anchor w \
69-
-borderwidth 1 \
70-
-relief solid
53+
paddedlabel $w.dirs -text $d
7154
pack $w.dirs -side top -fill x -padx 5 -pady 5
7255

7356
menu $w.ctxm -tearoff 0

git-gui/lib/blame.tcl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ field tooltip_timer {} ; # Current timer event for our tooltip
6161
field tooltip_commit {} ; # Commit(s) in tooltip
6262

6363
constructor new {i_commit i_path i_jump} {
64-
global cursor_ptr M1B M1T have_tk85
64+
global cursor_ptr M1B M1T have_tk85 use_ttk NS
6565
variable active_color
6666
variable group_colors
6767

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

7474
set font_w [font measure font_diff "0"]
7575

76-
frame $w.header -background gold
77-
label $w.header.commit_l \
76+
gold_frame $w.header
77+
tlabel $w.header.commit_l \
7878
-text [mc "Commit:"] \
7979
-background gold \
8080
-foreground black \
8181
-anchor w \
8282
-justify left
8383
set w_back $w.header.commit_b
84-
label $w_back \
84+
tlabel $w_back \
8585
-image ::blame::img_back_arrow \
8686
-borderwidth 0 \
8787
-relief flat \
@@ -94,20 +94,20 @@ constructor new {i_commit i_path i_jump} {
9494
[cb _history_menu]
9595
}
9696
"
97-
label $w.header.commit \
97+
tlabel $w.header.commit \
9898
-textvariable @commit \
9999
-background gold \
100100
-foreground black \
101101
-anchor w \
102102
-justify left
103-
label $w.header.path_l \
103+
tlabel $w.header.path_l \
104104
-text [mc "File:"] \
105105
-background gold \
106106
-foreground black \
107107
-anchor w \
108108
-justify left
109109
set w_path $w.header.path
110-
label $w_path \
110+
tlabel $w_path \
111111
-background gold \
112112
-foreground black \
113113
-anchor w \
@@ -209,10 +209,10 @@ constructor new {i_commit i_path i_jump} {
209209

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

212-
scrollbar $w.file_pane.out.sbx \
212+
${NS}::scrollbar $w.file_pane.out.sbx \
213213
-orient h \
214214
-command [list $w_file xview]
215-
scrollbar $w.file_pane.out.sby \
215+
${NS}::scrollbar $w.file_pane.out.sby \
216216
-orient v \
217217
-command [list scrollbar2many $w_columns yview]
218218
eval grid $w_columns $w.file_pane.out.sby -sticky nsew
@@ -254,10 +254,10 @@ constructor new {i_commit i_path i_jump} {
254254
-background $active_color \
255255
-font font_ui
256256
$w_cviewer tag raise sel
257-
scrollbar $w.file_pane.cm.sbx \
257+
${NS}::scrollbar $w.file_pane.cm.sbx \
258258
-orient h \
259259
-command [list $w_cviewer xview]
260-
scrollbar $w.file_pane.cm.sby \
260+
${NS}::scrollbar $w.file_pane.cm.sby \
261261
-orient v \
262262
-command [list $w_cviewer yview]
263263
pack $w.file_pane.cm.sby -side right -fill y

git-gui/lib/branch_checkout.tcl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,24 @@ field opt_fetch 1; # refetch tracking branch if used?
1010
field opt_detach 0; # force a detached head case?
1111

1212
constructor dialog {} {
13-
make_toplevel top w
13+
global use_ttk NS
14+
make_dialog top w
15+
wm withdraw $w
1416
wm title $top [append "[appname] ([reponame]): " [mc "Checkout Branch"]]
1517
if {$top ne {.}} {
1618
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
1719
}
1820

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

22-
frame $w.buttons
23-
button $w.buttons.create -text [mc Checkout] \
25+
${NS}::frame $w.buttons
26+
${NS}::button $w.buttons.create -text [mc Checkout] \
2427
-default active \
2528
-command [cb _checkout]
2629
pack $w.buttons.create -side right
27-
button $w.buttons.cancel -text [mc Cancel] \
30+
${NS}::button $w.buttons.cancel -text [mc Cancel] \
2831
-command [list destroy $w]
2932
pack $w.buttons.cancel -side right -padx 5
3033
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
@@ -33,14 +36,14 @@ constructor dialog {} {
3336
$w_rev bind_listbox <Double-Button-1> [cb _checkout]
3437
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5
3538

36-
labelframe $w.options -text [mc Options]
39+
${NS}::labelframe $w.options -text [mc Options]
3740

38-
checkbutton $w.options.fetch \
41+
${NS}::checkbutton $w.options.fetch \
3942
-text [mc "Fetch Tracking Branch"] \
4043
-variable @opt_fetch
4144
pack $w.options.fetch -anchor nw
4245

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

git-gui/lib/branch_create.tcl

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,48 @@ field opt_fetch 1; # refetch tracking branch if used?
1616
field reset_ok 0; # did the user agree to reset?
1717

1818
constructor dialog {} {
19-
global repo_config
19+
global repo_config use_ttk NS
2020

21-
make_toplevel top w
21+
make_dialog top w
22+
wm withdraw $w
2223
wm title $top [append "[appname] ([reponame]): " [mc "Create Branch"]]
2324
if {$top ne {.}} {
2425
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
2526
}
2627

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

30-
frame $w.buttons
31-
button $w.buttons.create -text [mc Create] \
32+
${NS}::frame $w.buttons
33+
${NS}::button $w.buttons.create -text [mc Create] \
3234
-default active \
3335
-command [cb _create]
3436
pack $w.buttons.create -side right
35-
button $w.buttons.cancel -text [mc Cancel] \
37+
${NS}::button $w.buttons.cancel -text [mc Cancel] \
3638
-command [list destroy $w]
3739
pack $w.buttons.cancel -side right -padx 5
3840
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
3941

40-
labelframe $w.desc -text [mc "Branch Name"]
41-
radiobutton $w.desc.name_r \
42-
-anchor w \
42+
${NS}::labelframe $w.desc -text [mc "Branch Name"]
43+
${NS}::radiobutton $w.desc.name_r \
4344
-text [mc "Name:"] \
4445
-value user \
4546
-variable @name_type
47+
if {!$use_ttk} {$w.desc.name_r configure -anchor w}
4648
set w_name $w.desc.name_t
47-
entry $w_name \
48-
-borderwidth 1 \
49-
-relief sunken \
49+
${NS}::entry $w_name \
5050
-width 40 \
5151
-textvariable @name \
5252
-validate key \
5353
-validatecommand [cb _validate %d %S]
5454
grid $w.desc.name_r $w_name -sticky we -padx {0 5}
5555

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

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

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

71-
frame $w.options.merge
72-
label $w.options.merge.l -text [mc "Update Existing Branch:"]
71+
${NS}::frame $w.options.merge
72+
${NS}::label $w.options.merge.l -text [mc "Update Existing Branch:"]
7373
pack $w.options.merge.l -side left
74-
radiobutton $w.options.merge.no \
74+
${NS}::radiobutton $w.options.merge.no \
7575
-text [mc No] \
7676
-value none \
7777
-variable @opt_merge
7878
pack $w.options.merge.no -side left
79-
radiobutton $w.options.merge.ff \
79+
${NS}::radiobutton $w.options.merge.ff \
8080
-text [mc "Fast Forward Only"] \
8181
-value ff \
8282
-variable @opt_merge
8383
pack $w.options.merge.ff -side left
84-
radiobutton $w.options.merge.reset \
84+
${NS}::radiobutton $w.options.merge.reset \
8585
-text [mc Reset] \
8686
-value reset \
8787
-variable @opt_merge
8888
pack $w.options.merge.reset -side left
8989
pack $w.options.merge -anchor nw
9090

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

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

git-gui/lib/branch_delete.tcl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,40 @@ field w_check ; # revision picker for merge test
99
field w_delete ; # delete button
1010

1111
constructor dialog {} {
12-
global current_branch
12+
global current_branch use_ttk NS
1313

14-
make_toplevel top w
14+
make_dialog top w
15+
wm withdraw $w
1516
wm title $top [append "[appname] ([reponame]): " [mc "Delete Branch"]]
1617
if {$top ne {.}} {
1718
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
1819
}
1920

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

23-
frame $w.buttons
25+
${NS}::frame $w.buttons
2426
set w_delete $w.buttons.delete
25-
button $w_delete \
27+
${NS}::button $w_delete \
2628
-text [mc Delete] \
2729
-default active \
2830
-state disabled \
2931
-command [cb _delete]
3032
pack $w_delete -side right
31-
button $w.buttons.cancel \
33+
${NS}::button $w.buttons.cancel \
3234
-text [mc Cancel] \
3335
-command [list destroy $w]
3436
pack $w.buttons.cancel -side right -padx 5
3537
pack $w.buttons -side bottom -fill x -pady 10 -padx 10
3638

37-
labelframe $w.list -text [mc "Local Branches"]
39+
${NS}::labelframe $w.list -text [mc "Local Branches"]
3840
set w_heads $w.list.l
39-
listbox $w_heads \
41+
slistbox $w_heads \
4042
-height 10 \
4143
-width 70 \
4244
-selectmode extended \
43-
-exportselection false \
44-
-yscrollcommand [list $w.list.sby set]
45-
scrollbar $w.list.sby -command [list $w.list.l yview]
46-
pack $w.list.sby -side right -fill y
45+
-exportselection false
4746
pack $w.list.l -side left -fill both -expand 1
4847
pack $w.list -fill both -expand 1 -pady 5 -padx 5
4948

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

0 commit comments

Comments
 (0)