Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-04-08 11:59:22 +0400
committerJunio C Hamano <junkio@cox.net>2007-04-09 06:54:07 +0400
commitc16d08713e2d7f5c440f7649ceb68f838b4b8bea (patch)
tree64b0991be4bb7a4a3c0aab7fe621634220ce3e09 /git-svn.perl
parent13c823fb520eaf1cded520213cf0ae4c3268208d (diff)
git-svn: fix log command to avoid infinite loop on long commit messages
This bug has been around since the the conversion to use the Git.pm library back in October or November. Eventually I'd like "git rev-list/log" to have the option to not truncate overly long messages. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl11
1 files changed, 9 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index e4079fb76c..ac44f60b81 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3263,12 +3263,19 @@ my $l_fmt;
sub cmt_showable {
my ($c) = @_;
return 1 if defined $c->{r};
+
+ # big commit message got truncated by the 16k pretty buffer in rev-list
if ($c->{l} && $c->{l}->[-1] eq "...\n" &&
$c->{a_raw} =~ /\@([a-f\d\-]+)>$/) {
+ @{$c->{l}} = ();
my @log = command(qw/cat-file commit/, $c->{c});
- shift @log while ($log[0] ne "\n");
+
+ # shift off the headers
+ shift @log while ($log[0] ne '');
shift @log;
- @{$c->{l}} = grep !/^git-svn-id: /, @log;
+
+ # TODO: make $c->{l} not have a trailing newline in the future
+ @{$c->{l}} = map { "$_\n" } grep !/^git-svn-id: /, @log;
(undef, $c->{r}, undef) = ::extract_metadata(
(grep(/^git-svn-id: /, @log))[-1]);