Commit 62304ffe authored by eric@webkit.org's avatar eric@webkit.org

2010-01-25 Chris Jerdonek <cjerdonek@webkit.org>

        Reviewed by Adam Barth.

        Improved prepare-ChangeLog so that it preserves the relative
        indentation of a git commit message.

        https://bugs.webkit.org/show_bug.cgi?id=34058

        * Scripts/prepare-ChangeLog:
          - Also adjusted the script so that it does not add white
            space characters to empty lines.

git-svn-id: svn://svn.chromium.org/blink/trunk@53796 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d6b791db
2010-01-25 Chris Jerdonek <cjerdonek@webkit.org>
Reviewed by Adam Barth.
Improved prepare-ChangeLog so that it preserves the relative
indentation of a git commit message.
https://bugs.webkit.org/show_bug.cgi?id=34058
* Scripts/prepare-ChangeLog:
- Also adjusted the script so that it does not add white
space characters to empty lines.
2010-01-24 Eric Seidel <eric@webkit.org> 2010-01-24 Eric Seidel <eric@webkit.org>
No review, rolling out r53763. No review, rolling out r53763.
......
...@@ -1606,6 +1606,7 @@ sub reviewerAndDescriptionForGitCommit($) ...@@ -1606,6 +1606,7 @@ sub reviewerAndDescriptionForGitCommit($)
$description .= "\n" if $commitLogCount; $description .= "\n" if $commitLogCount;
$commitLogCount++; $commitLogCount++;
my $inHeader = 1; my $inHeader = 1;
my $commitLogIndent;
my @lines = split(/\n/, $commitLog); my @lines = split(/\n/, $commitLog);
shift @lines; # Remove initial blank line shift @lines; # Remove initial blank line
foreach my $line (@lines) { foreach my $line (@lines) {
...@@ -1620,11 +1621,18 @@ sub reviewerAndDescriptionForGitCommit($) ...@@ -1620,11 +1621,18 @@ sub reviewerAndDescriptionForGitCommit($)
} else { } else {
$reviewer .= ", " . $1; $reviewer .= ", " . $1;
} }
} elsif (length $line == 0) { } elsif ($line =~ /^\s*$/) {
$description = $description . "\n"; $description = $description . "\n";
} else { } else {
$line =~ s/^\s*//; if (!defined($commitLogIndent)) {
$description = $description . " " . $line . "\n"; # Let the first line with non-white space determine
# the global indent.
$line =~ /^(\s*)\S/;
$commitLogIndent = length($1);
}
# Strip at most the indent to preserve relative indents.
$line =~ s/^\s{0,$commitLogIndent}//;
$description = $description . (" " x 8) . $line . "\n";
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment