Skip to content

Commit 3d252a9

Browse files
committed
Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui: git-gui: correct spelling errors in comments git-gui: add menu item to launch a bash shell on Windows. git-gui: corrected setup of git worktree under cygwin. git-gui: right half window is paned git-gui: Add gui.displayuntracked option git-gui: show the maxrecentrepo config option in the preferences dialog git-gui: added gui.maxrecentrepo to extend the number of remembered repos git-gui: Improve font rendering on retina macbooks
2 parents ec418bc + 73fd416 commit 3d252a9

File tree

8 files changed

+56
-17
lines changed

8 files changed

+56
-17
lines changed

git-gui/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ all::
44
#
55
# Define NO_MSGFMT if you do not have msgfmt from the GNU gettext
66
# package and want to use our rough pure Tcl po->msg translator.
7-
# TCL_PATH must be vaild for this to work.
7+
# TCL_PATH must be valid for this to work.
88
#
99

1010
GIT-VERSION-FILE: FORCE

git-gui/git-gui.sh

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ set default_config(gui.textconv) true
894894
set default_config(gui.pruneduringfetch) false
895895
set default_config(gui.trustmtime) false
896896
set default_config(gui.fastcopyblame) false
897+
set default_config(gui.maxrecentrepo) 10
897898
set default_config(gui.copyblamethreshold) 40
898899
set default_config(gui.blamehistoryctx) 7
899900
set default_config(gui.diffcontext) 5
@@ -912,6 +913,7 @@ set font_descs {
912913
{fontdiff font_diff {mc "Diff/Console Font"}}
913914
}
914915
set default_config(gui.stageuntracked) ask
916+
set default_config(gui.displayuntracked) true
915917
916918
######################################################################
917919
##
@@ -1282,7 +1284,11 @@ apply_config
12821284
12831285
# v1.7.0 introduced --show-toplevel to return the canonical work-tree
12841286
if {[package vsatisfies $_git_version 1.7.0]} {
1285-
set _gitworktree [git rev-parse --show-toplevel]
1287+
if { [is_Cygwin] } {
1288+
catch {set _gitworktree [exec cygpath --windows [git rev-parse --show-toplevel]]}
1289+
} else {
1290+
set _gitworktree [git rev-parse --show-toplevel]
1291+
}
12861292
} else {
12871293
# try to set work tree from environment, core.worktree or use
12881294
# cdup to obtain a relative path to the top of the worktree. If
@@ -1550,18 +1556,23 @@ proc rescan_stage2 {fd after} {
15501556
set buf_rdf {}
15511557
set buf_rlo {}
15521558
1553-
set rescan_active 3
1559+
set rescan_active 2
15541560
ui_status [mc "Scanning for modified files ..."]
15551561
set fd_di [git_read diff-index --cached -z [PARENT]]
15561562
set fd_df [git_read diff-files -z]
1557-
set fd_lo [eval git_read ls-files --others -z $ls_others]
15581563
15591564
fconfigure $fd_di -blocking 0 -translation binary -encoding binary
15601565
fconfigure $fd_df -blocking 0 -translation binary -encoding binary
1561-
fconfigure $fd_lo -blocking 0 -translation binary -encoding binary
1566+
15621567
fileevent $fd_di readable [list read_diff_index $fd_di $after]
15631568
fileevent $fd_df readable [list read_diff_files $fd_df $after]
1564-
fileevent $fd_lo readable [list read_ls_others $fd_lo $after]
1569+
1570+
if {[is_config_true gui.displayuntracked]} {
1571+
set fd_lo [eval git_read ls-files --others -z $ls_others]
1572+
fconfigure $fd_lo -blocking 0 -translation binary -encoding binary
1573+
fileevent $fd_lo readable [list read_ls_others $fd_lo $after]
1574+
incr rescan_active
1575+
}
15651576
}
15661577
15671578
proc load_message {file {encoding {}}} {
@@ -2654,6 +2665,16 @@ if {![is_bare]} {
26542665
.mbar.repository add command \
26552666
-label [mc "Explore Working Copy"] \
26562667
-command {do_explore}
2668+
}
2669+
2670+
if {[is_Windows]} {
2671+
.mbar.repository add command \
2672+
-label [mc "Git Bash"] \
2673+
-command {eval exec [auto_execok start] \
2674+
[list "Git Bash" bash --login -l &]}
2675+
}
2676+
2677+
if {[is_Windows] || ![is_bare]} {
26572678
.mbar.repository add separator
26582679
}
26592680
@@ -3203,13 +3224,19 @@ unset i
32033224
32043225
# -- Diff and Commit Area
32053226
#
3206-
${NS}::frame .vpane.lower -height 300 -width 400
3227+
${NS}::panedwindow .vpane.lower -orient vertical
32073228
${NS}::frame .vpane.lower.commarea
3208-
${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1
3209-
pack .vpane.lower.diff -fill both -expand 1
3210-
pack .vpane.lower.commarea -side bottom -fill x
3229+
${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
3230+
.vpane.lower add .vpane.lower.diff
3231+
.vpane.lower add .vpane.lower.commarea
32113232
.vpane add .vpane.lower
3212-
if {!$use_ttk} {.vpane paneconfigure .vpane.lower -sticky nsew}
3233+
if {$use_ttk} {
3234+
.vpane.lower pane .vpane.lower.diff -weight 1
3235+
.vpane.lower pane .vpane.lower.commarea -weight 0
3236+
} else {
3237+
.vpane.lower paneconfigure .vpane.lower.diff -stretch always
3238+
.vpane.lower paneconfigure .vpane.lower.commarea -stretch never
3239+
}
32133240
32143241
# -- Commit Area Buttons
32153242
#

git-gui/lib/blame.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class blame {
55

66
image create photo ::blame::img_back_arrow -data {R0lGODlhGAAYAIUAAPwCBEzKXFTSZIz+nGzmhGzqfGTidIT+nEzGXHTqhGzmfGzifFzadETCVES+VARWDFzWbHzyjAReDGTadFTOZDSyRDyyTCymPARaFGTedFzSbDy2TCyqRCyqPARaDAyCHES6VDy6VCyiPAR6HCSeNByWLARyFARiDARqFGTifARiFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAYABgAAAajQIBwSCwaj8ikcsk0BppJwRPqHEypQwHBis0WDAdEFyBIKBaMAKLBdjQeSkFBYTBAIvgEoS6JmhUTEwIUDQ4VFhcMGEhyCgoZExoUaxsWHB0THkgfAXUGAhoBDSAVFR0XBnCbDRmgog0hpSIiDJpJIyEQhBUcJCIlwA22SSYVogknEg8eD82qSigdDSknY0IqJQXPYxIl1dZCGNvWw+Dm510GQQAh/mhDcmVhdGVkIGJ5IEJNUFRvR0lGIFBybyB2ZXJzaW9uIDIuNQ0KqSBEZXZlbENvciAxOTk3LDE5OTguIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQpodHRwOi8vd3d3LmRldmVsY29yLmNvbQA7}
77

8-
# Persistant data (survives loads)
8+
# Persistent data (survives loads)
99
#
1010
field history {}; # viewer history: {commit path}
1111
field header ; # array commit,key -> header field

git-gui/lib/choose_repository.tcl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ field sorted_recent ; # recent repositories (sorted)
2424
constructor pick {} {
2525
global M1T M1B use_ttk NS
2626

27+
if {[set maxrecent [get_config gui.maxrecentrepo]] eq {}} {
28+
set maxrecent 10
29+
}
30+
2731
make_dialog top w
2832
wm title $top [mc "Git Gui"]
2933

@@ -148,7 +152,7 @@ constructor pick {} {
148152
-background [get_bg_color $w_body.recentlabel] \
149153
-wrap none \
150154
-width 50 \
151-
-height 10
155+
-height $maxrecent
152156
$w_recentlist tag conf link \
153157
-foreground blue \
154158
-underline 1
@@ -264,7 +268,11 @@ proc _append_recentrepos {path} {
264268
git config --global --add gui.recentrepo $path
265269
load_config 1
266270

267-
while {[llength $recent] > 10} {
271+
if {[set maxrecent [get_config gui.maxrecentrepo]] eq {}} {
272+
set maxrecent 10
273+
}
274+
275+
while {[llength $recent] > $maxrecent} {
268276
_unset_recentrepo [lindex $recent 0]
269277
set recent [lrange $recent 1 end]
270278
}

git-gui/lib/index.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ proc revert_helper {txt paths} {
414414
# such distinction is needed in some languages. Previously, the
415415
# code used "Revert changes in" for both, but that can't work
416416
# in languages where 'in' must be combined with word from
417-
# rest of string (in diffrent way for both cases of course).
417+
# rest of string (in different way for both cases of course).
418418
#
419419
# FIXME: Unfortunately, even that isn't enough in some languages
420420
# as they have quite complex plural-form rules. Unfortunately,

git-gui/lib/option.tcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ proc do_options {} {
150150
{b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
151151
{b gui.textconv {mc "Use Textconv For Diffs and Blames"}}
152152
{b gui.fastcopyblame {mc "Blame Copy Only On Changed Files"}}
153+
{i-0..100 gui.maxrecentrepo {mc "Maximum Length of Recent Repositories List"}}
153154
{i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
154155
{i-0..300 gui.blamehistoryctx {mc "Blame History Context Radius (days)"}}
155156
{i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
@@ -159,6 +160,7 @@ proc do_options {} {
159160
{c gui.encoding {mc "Default File Contents Encoding"}}
160161
{b gui.warndetachedcommit {mc "Warn before committing to a detached head"}}
161162
{s gui.stageuntracked {mc "Staging of untracked files"} {list "yes" "no" "ask"}}
163+
{b gui.displayuntracked {mc "Show untracked files"}}
162164
} {
163165
set type [lindex $option 0]
164166
set name [lindex $option 1]

git-gui/lib/spellcheck.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ field w_menu ; # context menu for the widget
1414
field s_menuidx 0 ; # last index of insertion into $w_menu
1515

1616
field s_i {} ; # timer registration for _run callbacks
17-
field s_clear 0 ; # did we erase mispelled tags yet?
17+
field s_clear 0 ; # did we erase misspelled tags yet?
1818
field s_seen [list] ; # lines last seen from $w_text in _run
1919
field s_checked [list] ; # lines already checked
2020
field s_pending [list] ; # [$line $data] sent to ispell/aspell
@@ -259,7 +259,7 @@ method _run {} {
259259
if {$n == $cur_line
260260
&& ![regexp {^\W$} [$w_text get $cur_pos insert]]} {
261261

262-
# If the current word is mispelled remove the tag
262+
# If the current word is misspelled remove the tag
263263
# but force a spellcheck later.
264264
#
265265
set tags [$w_text tag names $cur_pos]

git-gui/macosx/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@
2424
<string>GITg</string>
2525
<key>CFBundleVersion</key>
2626
<string>@@GITGUI_VERSION@@</string>
27+
<key>NSHighResolutionCapable</key>
28+
<true/>
2729
</dict>
2830
</plist>

0 commit comments

Comments
 (0)