提交 8b192809 编写于 作者: L Linus Torvalds 提交者: Paul Mackerras

[PATCH] gitk "parent information" in commit window

This adds a useful "Parent:" line to the git commit information window.

It looks something like this (from the infamous octopus merge):

	Author: Junio C Hamano <junkio@cox.net>  2005-05-05 16:16:54
	Committer: Junio C Hamano <junkio@cox.net>  2005-05-05 16:16:54
	Parent: fc54a9c3  (Update git-apply-patch-script ...)
	Parent: 9e30dd7c  (Make git-prune-script executa ...)
	Parent: c4b83e61  (Do not write out new index if ...)
	Parent: 66026590  (diff-cache shows differences  ...)
	Parent: b28858bf  (Update diff engine for symlin ...)

	    Octopus merge of the following five patches.

	      Update git-apply-patch-script for symbolic links.
	      Make git-prune-script executable again.
	      Do not write out new index if nothing has changed.
	      diff-cache shows differences for unmerged paths without --cache.
	      Update diff engine for symlinks stored in the cache.
Signed-off-by: NJunio C Hamano <junkio@cox.net>

where all the parent commit ID's are clickable, because the new lines are
added as part of the "comment" string, and thus the regular clickability
thing will match them automatically.

I think this is good. And my random-tcl-monkey-skills are clearly getting
better (although it's perfectly possible that somebody who actually knows
what he is doing would have done things differently).
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 d6e8149b
......@@ -1799,9 +1799,21 @@ proc selectline {l isnew} {
}
$ctext insert end "\n"
}
$ctext insert end "\n"
set commentstart [$ctext index "end - 1c"]
set comment [lindex $info 5]
set comment {}
foreach p $parents($id) {
set l "..."
if {[info exists commitinfo($p)]} {
set l [lindex $commitinfo($p) 0]
if {[string length $l] > 32} {
set l "[string range $l 0 28] ..."
}
}
append comment "Parent: $p ($l)\n"
}
append comment "\n"
append comment [lindex $info 5]
$ctext insert end $comment
$ctext insert end "\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册