Skip to content

Commit 7defefb

Browse files
Kirill Smelkovpaulusmack
authored andcommitted
gitk: Show notes by default (like git log does)
Starting from ~ git-1.6.6, log, show & whatchanged show notes by default. On the other hand, gitk does not show notes by default, because under the hood it calls 'git log --pretty=raw ...' to get the log, and in 'git log' notes are turned off when user specifies format or pretty settings. Yes, it is possible to invoke 'gitk --show-notes' explicitly, but since from user's perspective, gitk is gui enabled git log, it would be logical for gitk to show notes by default too for consistency. In git, --show-notes was introduced in 66b2ed (Fix "log" family not to be too agressive about showing notes) which predates 1.6.6.2. Notes can still be supressed with 'gitk --no-notes'. Cc: Michael J Gruber <[email protected]> Signed-off-by: Kirill Smelkov <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent a1d383c commit 7defefb

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

gitk

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ proc start_rev_list {view} {
313313
global viewactive viewinstances vmergeonly
314314
global mainheadid viewmainheadid viewmainheadid_orig
315315
global vcanopt vflags vrevs vorigargs
316+
global show_notes
316317

317318
set startmsecs [clock clicks -milliseconds]
318319
set commitidx($view) 0
@@ -361,8 +362,8 @@ proc start_rev_list {view} {
361362
}
362363

363364
if {[catch {
364-
set fd [open [concat | git log --no-color -z --pretty=raw --parents \
365-
--boundary $args "--" $files] r]
365+
set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
366+
--parents --boundary $args "--" $files] r]
366367
} err]} {
367368
error_popup "[mc "Error executing git log:"] $err"
368369
return 0
@@ -456,6 +457,7 @@ proc updatecommits {} {
456457
global mainheadid viewmainheadid viewmainheadid_orig pending_select
457458
global isworktree
458459
global varcid vposids vnegids vflags vrevs
460+
global show_notes
459461

460462
set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
461463
rereadrefs
@@ -508,8 +510,8 @@ proc updatecommits {} {
508510
set args $vorigargs($view)
509511
}
510512
if {[catch {
511-
set fd [open [concat | git log --no-color -z --pretty=raw --parents \
512-
--boundary $args "--" $vfilelimit($view)] r]
513+
set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
514+
--parents --boundary $args "--" $vfilelimit($view)] r]
513515
} err]} {
514516
error_popup "[mc "Error executing git log:"] $err"
515517
return
@@ -11521,6 +11523,11 @@ set NS [expr {$use_ttk ? "ttk" : ""}]
1152111523

1152211524
set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]
1152311525

11526+
set show_notes {}
11527+
if {[package vcompare $git_version "1.6.6.2"] >= 0} {
11528+
set show_notes "--show-notes"
11529+
}
11530+
1152411531
set runq {}
1152511532
set history {}
1152611533
set historyindex 0

0 commit comments

Comments
 (0)