git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] gitk: Show notes by default (like git log do)
@ 2010-05-20  9:50 Kirill Smelkov
  2010-05-30  2:22 ` Paul Mackerras
  0 siblings, 1 reply; 2+ messages in thread
From: Kirill Smelkov @ 2010-05-20  9:50 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git, Kirill Smelkov, Michael J Gruber

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 <git@drmicha.warpmail.net>
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
---
 gitk |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

Changes since first post:

 o as suggested by Michael, removed --show-notes from do_readcommit

 o as suggested by Michael, tried to put --show-notes arg into a central place

 o --show-notes is only used for git >= 1.6.6.2 (though because $git_version
   has only 3 digits, this may turn to be actually activated only from
   git >= 1.7.0)

diff --git a/gitk b/gitk
index 1b0e09a..45e3380 100755
--- a/gitk
+++ b/gitk
@@ -313,6 +313,7 @@ proc start_rev_list {view} {
     global viewactive viewinstances vmergeonly
     global mainheadid viewmainheadid viewmainheadid_orig
     global vcanopt vflags vrevs vorigargs
+    global show_notes
 
     set startmsecs [clock clicks -milliseconds]
     set commitidx($view) 0
@@ -361,8 +362,8 @@ proc start_rev_list {view} {
     }
 
     if {[catch {
-	set fd [open [concat | git log --no-color -z --pretty=raw --parents \
-			 --boundary $args "--" $files] r]
+	set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
+			--parents --boundary $args "--" $files] r]
     } err]} {
 	error_popup "[mc "Error executing git log:"] $err"
 	return 0
@@ -456,6 +457,7 @@ proc updatecommits {} {
     global mainheadid viewmainheadid viewmainheadid_orig pending_select
     global isworktree
     global varcid vposids vnegids vflags vrevs
+    global show_notes
 
     set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
     rereadrefs
@@ -508,8 +510,8 @@ proc updatecommits {} {
 	set args $vorigargs($view)
     }
     if {[catch {
-	set fd [open [concat | git log --no-color -z --pretty=raw --parents \
-			  --boundary $args "--" $vfilelimit($view)] r]
+	set fd [open [concat | git log --no-color -z --pretty=raw $show_notes \
+			--parents --boundary $args "--" $vfilelimit($view)] r]
     } err]} {
 	error_popup "[mc "Error executing git log:"] $err"
 	return
@@ -11521,6 +11523,11 @@ set NS [expr {$use_ttk ? "ttk" : ""}]
 
 set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]
 
+set show_notes {}
+if {[package vcompare $git_version "1.6.6.2"] >= 0} {
+    set show_notes "--show-notes"
+}
+
 set runq {}
 set history {}
 set historyindex 0
-- 
1.7.1.91.ga63a7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] gitk: Show notes by default (like git log do)
  2010-05-20  9:50 [PATCH v2] gitk: Show notes by default (like git log do) Kirill Smelkov
@ 2010-05-30  2:22 ` Paul Mackerras
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Mackerras @ 2010-05-30  2:22 UTC (permalink / raw)
  To: Kirill Smelkov; +Cc: git, Michael J Gruber

On Thu, May 20, 2010 at 01:50:41PM +0400, Kirill Smelkov wrote:

> 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 <git@drmicha.warpmail.net>
> Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>

Thanks, applied.

Paul.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-30  2:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20  9:50 [PATCH v2] gitk: Show notes by default (like git log do) Kirill Smelkov
2010-05-30  2:22 ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).