Skip to content

Commit 7a15939

Browse files
author
Junio C Hamano
committed
Merge branch 'maint'
* maint: Document -g (--walk-reflogs) option of git-log sscanf/strtoul: parse integers robustly git-blame: Fix overrun in fake_working_tree_commit() [PATCH] Improve look-and-feel of the gitk tool. [PATCH] Teach gitk to use the user-defined UI font everywhere.
2 parents b073211 + 5f2e1df commit 7a15939

File tree

3 files changed

+44
-15
lines changed

3 files changed

+44
-15
lines changed

Documentation/git-log.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ include::pretty-formats.txt[]
4646
-p::
4747
Show the change the commit introduces in a patch form.
4848

49+
-g, \--walk-reflogs::
50+
Show commits as they were recorded in the reflog. The log contains
51+
a record about how the tip of a reference was changed.
52+
See also gitlink:git-reflog[1].
53+
4954
<paths>...::
5055
Show only commits that affect the specified paths.
5156

builtin-blame.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,7 @@ static struct commit *fake_working_tree_commit(const char *path, const char *con
20412041

20422042
commit->buffer = xmalloc(400);
20432043
ident = fmt_ident("Not Committed Yet", "not.committed.yet", NULL, 0);
2044-
sprintf(commit->buffer,
2044+
snprintf(commit->buffer, 400,
20452045
"tree 0000000000000000000000000000000000000000\n"
20462046
"parent %s\n"
20472047
"author %s\n"

gitk

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,10 @@ proc makewindow {} {
648648
frame .bright.mode
649649
radiobutton .bright.mode.patch -text "Patch" \
650650
-command reselectline -variable cmitmode -value "patch"
651+
.bright.mode.patch configure -font $uifont
651652
radiobutton .bright.mode.tree -text "Tree" \
652653
-command reselectline -variable cmitmode -value "tree"
654+
.bright.mode.tree configure -font $uifont
653655
grid .bright.mode.patch .bright.mode.tree -sticky ew
654656
pack .bright.mode -side top -fill x
655657
set cflist .bright.cfiles
@@ -922,6 +924,7 @@ proc bindall {event action} {
922924
}
923925

924926
proc about {} {
927+
global uifont
925928
set w .about
926929
if {[winfo exists $w]} {
927930
raise $w
@@ -935,13 +938,19 @@ Gitk - a commit viewer for git
935938
Copyright © 2005-2006 Paul Mackerras
936939

937940
Use and redistribute under the terms of the GNU General Public License} \
938-
-justify center -aspect 400
939-
pack $w.m -side top -fill x -padx 20 -pady 20
940-
button $w.ok -text Close -command "destroy $w"
941+
-justify center -aspect 400 -border 2 -bg white -relief groove
942+
pack $w.m -side top -fill x -padx 2 -pady 2
943+
$w.m configure -font $uifont
944+
button $w.ok -text Close -command "destroy $w" -default active
941945
pack $w.ok -side bottom
946+
$w.ok configure -font $uifont
947+
bind $w <Visibility> "focus $w.ok"
948+
bind $w <Key-Escape> "destroy $w"
949+
bind $w <Key-Return> "destroy $w"
942950
}
943951

944952
proc keys {} {
953+
global uifont
945954
set w .keys
946955
if {[winfo exists $w]} {
947956
raise $w
@@ -988,10 +997,15 @@ f Scroll diff view to next file
988997
<Ctrl-minus> Decrease font size
989998
<F5> Update
990999
} \
991-
-justify left -bg white -border 2 -relief sunken
992-
pack $w.m -side top -fill both
993-
button $w.ok -text Close -command "destroy $w"
1000+
-justify left -bg white -border 2 -relief groove
1001+
pack $w.m -side top -fill both -padx 2 -pady 2
1002+
$w.m configure -font $uifont
1003+
button $w.ok -text Close -command "destroy $w" -default active
9941004
pack $w.ok -side bottom
1005+
$w.ok configure -font $uifont
1006+
bind $w <Visibility> "focus $w.ok"
1007+
bind $w <Key-Escape> "destroy $w"
1008+
bind $w <Key-Return> "destroy $w"
9951009
}
9961010

9971011
# Procedures for manipulating the file list window at the
@@ -1457,20 +1471,21 @@ proc vieweditor {top n title} {
14571471
toplevel $top
14581472
wm title $top $title
14591473
label $top.nl -text "Name" -font $uifont
1460-
entry $top.name -width 20 -textvariable newviewname($n)
1474+
entry $top.name -width 20 -textvariable newviewname($n) -font $uifont
14611475
grid $top.nl $top.name -sticky w -pady 5
1462-
checkbutton $top.perm -text "Remember this view" -variable newviewperm($n)
1476+
checkbutton $top.perm -text "Remember this view" -variable newviewperm($n) \
1477+
-font $uifont
14631478
grid $top.perm - -pady 5 -sticky w
14641479
message $top.al -aspect 1000 -font $uifont \
14651480
-text "Commits to include (arguments to git rev-list):"
14661481
grid $top.al - -sticky w -pady 5
14671482
entry $top.args -width 50 -textvariable newviewargs($n) \
1468-
-background white
1483+
-background white -font $uifont
14691484
grid $top.args - -sticky ew -padx 5
14701485
message $top.l -aspect 1000 -font $uifont \
14711486
-text "Enter files and directories to include, one per line:"
14721487
grid $top.l - -sticky w
1473-
text $top.t -width 40 -height 10 -background white
1488+
text $top.t -width 40 -height 10 -background white -font $uifont
14741489
if {[info exists viewfiles($n)]} {
14751490
foreach f $viewfiles($n) {
14761491
$top.t insert end $f
@@ -1481,8 +1496,10 @@ proc vieweditor {top n title} {
14811496
}
14821497
grid $top.t - -sticky ew -padx 5
14831498
frame $top.buts
1484-
button $top.buts.ok -text "OK" -command [list newviewok $top $n]
1485-
button $top.buts.can -text "Cancel" -command [list destroy $top]
1499+
button $top.buts.ok -text "OK" -command [list newviewok $top $n] \
1500+
-font $uifont
1501+
button $top.buts.can -text "Cancel" -command [list destroy $top] \
1502+
-font $uifont
14861503
grid $top.buts.ok $top.buts.can
14871504
grid columnconfigure $top.buts 0 -weight 1 -uniform a
14881505
grid columnconfigure $top.buts 1 -weight 1 -uniform a
@@ -5813,6 +5830,7 @@ proc doprefs {} {
58135830
global maxwidth maxgraphpct diffopts
58145831
global oldprefs prefstop showneartags
58155832
global bgcolor fgcolor ctext diffcolors
5833+
global uifont
58165834

58175835
set top .gitkprefs
58185836
set prefstop $top
@@ -5826,6 +5844,7 @@ proc doprefs {} {
58265844
toplevel $top
58275845
wm title $top "Gitk preferences"
58285846
label $top.ldisp -text "Commit list display options"
5847+
$top.ldisp configure -font $uifont
58295848
grid $top.ldisp - -sticky w -pady 10
58305849
label $top.spacer -text " "
58315850
label $top.maxwidthl -text "Maximum graph width (lines)" \
@@ -5838,6 +5857,7 @@ proc doprefs {} {
58385857
grid x $top.maxpctl $top.maxpct -sticky w
58395858

58405859
label $top.ddisp -text "Diff display options"
5860+
$top.ddisp configure -font $uifont
58415861
grid $top.ddisp - -sticky w -pady 10
58425862
label $top.diffoptl -text "Options for diff program" \
58435863
-font optionfont
@@ -5850,6 +5870,7 @@ proc doprefs {} {
58505870
grid x $top.ntag -sticky w
58515871

58525872
label $top.cdisp -text "Colors: press to choose"
5873+
$top.cdisp configure -font $uifont
58535874
grid $top.cdisp - -sticky w -pady 10
58545875
label $top.bg -padx 40 -relief sunk -background $bgcolor
58555876
button $top.bgbut -text "Background" -font optionfont \
@@ -5877,12 +5898,15 @@ proc doprefs {} {
58775898
grid x $top.hunksepbut $top.hunksep -sticky w
58785899

58795900
frame $top.buts
5880-
button $top.buts.ok -text "OK" -command prefsok
5881-
button $top.buts.can -text "Cancel" -command prefscan
5901+
button $top.buts.ok -text "OK" -command prefsok -default active
5902+
$top.buts.ok configure -font $uifont
5903+
button $top.buts.can -text "Cancel" -command prefscan -default normal
5904+
$top.buts.can configure -font $uifont
58825905
grid $top.buts.ok $top.buts.can
58835906
grid columnconfigure $top.buts 0 -weight 1 -uniform a
58845907
grid columnconfigure $top.buts 1 -weight 1 -uniform a
58855908
grid $top.buts - - -pady 10 -sticky ew
5909+
bind $top <Visibility> "focus $top.buts.ok"
58865910
}
58875911

58885912
proc choosecolor {v vi w x cmd} {

0 commit comments

Comments
 (0)