git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Karl Hasselstr?m <kha@treskal.com>,
	Paul Mackerras <paulus@samba.org>,
	Junio C Hamano <junkio@cox.net>
Cc: Carl Worth <cworth@cworth.org>,
	Michael Niedermayer <michaelni@gmx.at>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: FFmpeg considering GIT
Date: Sat, 5 May 2007 15:30:24 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.98.0705051524300.17381@woody.linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.0.98.0705051511020.17381@woody.linux-foundation.org>



On Sat, 5 May 2007, Linus Torvalds wrote:
> 
> (It also shows that my "gitk" patch was incorrectly getting the commit 
> name from character 6 onward, even though it should have been 7, but I'll 
> also try to make gitk understand the "<" and ">" markers, and make it 
> possible to say
> 
> 	gitk --left-right a...b
> 
> and have the commits colored appropriately. That would be cool, but it 
> might need more tcl/tk knowledge than I actually possess).

Ok, that turned out to be the case.

Here's an updated patch to gitk, which at least *parses* the 
"--left-right" data properly, it just doesn't use it. But with the fix to 
"git log" I just posted, and this, you at least have the same capabilities 
gitk used to have, and it should be fairly easy for somebody who knows 
tcltk to squirrel away the "leftright" data per commit and use that to 
color the commit lines in the top-most pane.

I'm also sure the "if first character is one of '-'/'<'/'>'" test can be 
written more prettily, rather than have three if-statements on it. 

Finally, it realy _should_ check that the first 7 characters of the commit 
log (the ones it ignores by just asking for substring 7..) are actually 
the exact characters "commit ", but I'll blame my lack of comfort with the 
language again.

Somebody? Please? It really should be pretty cool. Do

	gitk --left-right commit^1...commit^2

for an appropriate 'commit' that is a merge, and the two sides getting 
merged should show up with different colors!

		Linus

----
 gitk |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/gitk b/gitk
index b1c65d7..0bf00ee 100755
--- a/gitk
+++ b/gitk
@@ -33,8 +33,8 @@ proc start_rev_list {view} {
 	set order "--date-order"
     }
     if {[catch {
-	set fd [open [concat | git rev-list --header $order \
-			  --parents --boundary --default HEAD $args] r]
+	set fd [open [concat | git log -z --pretty=raw $order \
+			  --parents --boundary $args] r]
     } err]} {
 	puts stderr "Error executing git rev-list: $err"
 	exit 1
@@ -127,13 +127,23 @@ proc getcommitlines {fd view}  {
 	set start [expr {$i + 1}]
 	set j [string first "\n" $cmit]
 	set ok 0
+	set leftright 0
 	set listed 1
 	if {$j >= 0} {
-	    set ids [string range $cmit 0 [expr {$j - 1}]]
+	    # start with 'commit '
+	    set ids [string range $cmit 7 [expr {$j - 1}]]
 	    if {[string range $ids 0 0] == "-"} {
 		set listed 0
 		set ids [string range $ids 1 end]
 	    }
+	    if {[string range $ids 0 0] == "<"} {
+		set leftright -1
+		set ids [string range $ids 1 end]
+	    }
+	    if {[string range $ids 0 0] == ">"} {
+		set leftright 1
+		set ids [string range $ids 1 end]
+	    }
 	    set ok 1
 	    foreach id $ids {
 		if {[string length $id] != 40} {
@@ -147,7 +157,7 @@ proc getcommitlines {fd view}  {
 	    if {[string length $shortcmit] > 80} {
 		set shortcmit "[string range $shortcmit 0 80]..."
 	    }
-	    error_popup "Can't parse git rev-list output: {$shortcmit}"
+	    error_popup "Can't parse git git log output: {$shortcmit}"
 	    exit 1
 	}
 	set id [lindex $ids 0]

  reply	other threads:[~2007-05-05 22:30 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-02  9:29 FFmpeg considering GIT Panagiotis Issaris
2007-05-02 23:48 ` Jakub Narebski
2007-05-03  1:03   ` Petr Baudis
2007-05-04  0:42     ` Jakub Narebski
2007-05-04  7:21       ` [RFC?] Telling git about more complex relationships between commits (Was: Re: FFmpeg considering GIT) Johan Herland
2007-05-04  9:36         ` Alex Riesen
2007-05-04 11:39           ` Andy Parkins
2007-05-04 12:06             ` Andrew Ruder
2007-05-04 12:30             ` Johan Herland
2007-05-04 11:53           ` Johan Herland
2007-05-04 22:11             ` Alex Riesen
2007-05-05 12:49               ` Johan Herland
2007-05-05 18:03                 ` Alex Riesen
2007-05-05 16:13               ` Johan Herland
2007-05-04 11:10         ` Petr Baudis
2007-05-04 12:22           ` Johan Herland
2007-05-03  1:48 ` FFmpeg considering GIT Martin Langhoff
2007-05-03 18:00 ` Uwe Kleine-König
2007-05-03 20:00   ` Petr Baudis
2007-05-03 20:05     ` david
2007-05-03 20:13       ` Petr Baudis
2007-05-04 13:46     ` Michael Niedermayer
2007-05-04 15:53       ` Andy Parkins
2007-05-04 16:09         ` Johannes Sixt
2007-05-04 17:23           ` Florian Weimer
2007-05-04 16:40       ` Nicolas Pitre
2007-05-04 18:17       ` Carl Worth
2007-05-04 18:25         ` Johan Herland
2007-05-04 20:24         ` Michael Niedermayer
2007-05-05  4:15           ` Linus Torvalds
2007-05-05 13:35         ` Karl Hasselström
2007-05-05 17:26           ` Linus Torvalds
2007-05-05 22:18             ` Linus Torvalds
2007-05-05 22:30               ` Linus Torvalds [this message]
2007-05-06  7:49                 ` Junio C Hamano
2007-05-07 12:13                 ` Paul Mackerras
2007-05-07 12:30                   ` Karl Hasselström
2007-05-07 12:50                   ` Johan Herland
2007-05-07 12:56                   ` Alex Riesen
2007-05-08  6:30                     ` Marco Costalba
2007-05-09  4:28                       ` Paul Mackerras
2007-05-09  6:38                         ` Marco Costalba
2007-05-09 18:17                           ` Robin Rosenberg
2007-05-09 18:28                           ` Jan Hudec
2007-05-09 21:09                             ` Fredrik Kuivinen
2007-05-09 21:36                               ` Jan Hudec
2007-05-10 11:20                                 ` Marco Costalba
2007-05-10 16:52                                   ` Jan Hudec
2007-05-07 17:52                   ` Jan Hudec
2007-05-07 22:10                     ` Gábor Farkas
2007-05-07 23:21                       ` Randal L. Schwartz
     [not found]                       ` <fcaeb9bf0705080707x7ad28afelf98ecd93276042d1@mail.gmail.com>
2007-05-08 15:53                         ` Gábor Farkas
2007-05-07 19:10                   ` Junio C Hamano
2007-05-08  2:03                   ` Shawn O. Pearce
2007-05-08  7:26                   ` Jeff King
2007-05-06  7:56             ` Karl Hasselström
2007-05-06 10:19             ` Karl Hasselström
2007-05-06 16:38               ` Linus Torvalds
2007-05-06  8:15           ` Marco Costalba
2007-05-06 11:14             ` Karl Hasselström
2007-05-06 12:19               ` Marco Costalba
2007-05-06 12:33                 ` Karl Hasselström
2007-05-06 12:33                 ` Marco Costalba
2007-05-06 12:59                   ` Karl Hasselström
2007-05-06 13:03                     ` Karl Hasselström
2007-05-09 22:30                     ` Pavel Roskin
  -- strict thread matches above, loose matches on Subject: below --
2007-05-08  3:39 Brett Schwarz
2007-05-08  4:06 ` Paul Mackerras
2007-05-08  4:19   ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.0.98.0705051524300.17381@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=cworth@cworth.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=kha@treskal.com \
    --cc=michaelni@gmx.at \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).