summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7eb3cb9)
raw | patch | inline | side by side (parent: 7eb3cb9)
author | Paul Mackerras <paulus@samba.org> | |
Wed, 27 Sep 2006 00:56:02 +0000 (10:56 +1000) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Sat, 23 Jun 2007 10:55:43 +0000 (20:55 +1000) |
In some repositories imported from other systems we can get carriage
return characters in the commit message, which leads to a multi-line
headline being displayed in the summary window, which looks bad.
Also some commit messages start with one or more blank lines, which
leads to an empty headline. This fixes these problems.
Signed-off-by: Paul Mackerras <paulus@samba.org>
return characters in the commit message, which leads to a multi-line
headline being displayed in the summary window, which looks bad.
Also some commit messages start with one or more blank lines, which
leads to an empty headline. This fixes these problems.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 1b573e046a21193f894106fc46d1dfb734754804..0c2767df0b6ab54fa16e8cdbd8ea9dd2000148e2 100755 (executable)
--- a/gitk
+++ b/gitk
}
}
set headline {}
- # take the first line of the comment as the headline
- set i [string first "\n" $comment]
+ # take the first non-blank line of the comment as the headline
+ set headline [string trimleft $comment]
+ set i [string first "\n" $headline]
if {$i >= 0} {
- set headline [string trim [string range $comment 0 $i]]
- } else {
- set headline $comment
+ set headline [string range $headline 0 $i]
+ }
+ set headline [string trimright $headline]
+ set i [string first "\r" $headline]
+ if {$i >= 0} {
+ set headline [string trimright [string range $headline 0 $i]]
}
if {!$listed} {
# git rev-list indents the comment by 4 spaces;
dispneartags 1
}
$ctext insert end "\n"
- appendwithlinks [lindex $info 5] {comment}
+ set comment [lindex $info 5]
+ if {[string first "\r" $comment] >= 0} {
+ set comment [string map {"\r" "\n "} $comment]
+ }
+ appendwithlinks $comment {comment}
$ctext tag delete Comments
$ctext tag remove found 1.0 end