{"thread":{"id":"7565","subject":"[PATCH] git-svn: fix log command to avoid infinite loop on long commit messages","startedAt":"2007-04-08T07:59:22Z","lastAt":"2007-04-08T07:59:22Z","messageCount":1,"participants":["Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"38876","messageId":"11760191623184-git-send-email-normalperson@yhbt.net","threadId":"7565","inReplyTo":null,"subject":"[PATCH] git-svn: fix log command to avoid infinite loop on long commit messages","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-04-08T07:59:22Z","receivedAt":"2007-04-08T07:59:22Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"This bug has been around since the the conversion to use the\nGit.pm library back in October or November.  Eventually I'd like\n\"git rev-list/log\" to have the option to not truncate overly\nlong messages.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |   11 +++++++++--\n 1 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex e4079fb..ac44f60 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -3263,12 +3263,19 @@ my $l_fmt;\n sub cmt_showable {\n \tmy ($c) = @_;\n \treturn 1 if defined $c->{r};\n+\n+\t# big commit message got truncated by the 16k pretty buffer in rev-list\n \tif ($c->{l} && $c->{l}->[-1] eq \"...\\n\" &&\n \t\t\t\t$c->{a_raw} =~ /\\@([a-f\\d\\-]+)>$/) {\n+\t\t@{$c->{l}} = ();\n \t\tmy @log = command(qw/cat-file commit/, $c->{c});\n-\t\tshift @log while ($log[0] ne \"\\n\");\n+\n+\t\t# shift off the headers\n+\t\tshift @log while ($log[0] ne '');\n \t\tshift @log;\n-\t\t@{$c->{l}} = grep !/^git-svn-id: /, @log;\n+\n+\t\t# TODO: make $c->{l} not have a trailing newline in the future\n+\t\t@{$c->{l}} = map { \"$_\\n\" } grep !/^git-svn-id: /, @log;\n \n \t\t(undef, $c->{r}, undef) = ::extract_metadata(\n \t\t\t\t(grep(/^git-svn-id: /, @log))[-1]);\n-- \n1.5.1.82.g8c65-dirty\n"}]}