git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] gitk: Show patch for initial commit
@ 2011-10-01 19:05 Marcus Karlsson
  2011-10-01 21:03 ` Zbigniew Jędrzejewski-Szmek
  0 siblings, 1 reply; 4+ messages in thread
From: Marcus Karlsson @ 2011-10-01 19:05 UTC (permalink / raw)
  To: git; +Cc: gitster, zbyszek

Make gitk show the patch for the initial commit by default.
Override with log.showroot.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>
---
 gitk-git/gitk |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index 4cde0c4..40ea73f 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -7402,7 +7402,7 @@ proc addtocflist {ids} {
 }
 
 proc diffcmd {ids flags} {
-    global nullid nullid2
+    global log_showroot nullid nullid2
 
     set i [lsearch -exact $ids $nullid]
     set j [lsearch -exact $ids $nullid2]
@@ -7436,7 +7436,11 @@ proc diffcmd {ids flags} {
 	    lappend cmd HEAD
 	}
     } else {
-	set cmd [concat | git diff-tree -r $flags $ids]
+	set cmd [concat | git diff-tree -r]
+	if {$log_showroot eq true} {
+	    set cmd [concat $cmd --root]
+	}
+	set cmd [concat $cmd $flags $ids]
     }
     return $cmd
 }
@@ -11403,6 +11407,11 @@ catch {
     }
 }
 
+set log_showroot true
+catch {
+    set log_showroot [exec git config --get log.showroot]
+}
+
 if {[tk windowingsystem] eq "aqua"} {
     set mainfont {{Lucida Grande} 9}
     set textfont {Monaco 9}
-- 
1.7.7

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

end of thread, other threads:[~2011-10-03 17:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-01 19:05 [PATCH v2] gitk: Show patch for initial commit Marcus Karlsson
2011-10-01 21:03 ` Zbigniew Jędrzejewski-Szmek
2011-10-03  6:33   ` Marcus Karlsson
2011-10-03 17:44     ` Junio C Hamano

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).