git-remote-mediawiki: don't compute the diff when getting commit message
[gitweb.git] / contrib / mw-to-git / git-remote-mediawiki
index 539718e243ba2474752e14ee6cb1f384eb2baa6b..e929b7a728c04be911783e005afa5a49bcc1a48c 100755 (executable)
@@ -873,8 +873,8 @@ sub mw_push_revision {
                # TODO: we could detect rename, and encode them with a #redirect on the wiki.
                # TODO: for now, it's just a delete+add
                my @diff_info_list = split(/\0/, $diff_infos);
-               # Keep the first line of the commit message as mediawiki comment for the revision
-               my $commit_msg = (split(/\n/, run_git("show --pretty=format:\"%s\" $sha1_commit")))[0];
+               # Keep the subject line of the commit message as mediawiki comment for the revision
+               my $commit_msg = run_git("log --no-walk --format=\"%s\" $sha1_commit");
                chomp($commit_msg);
                # Push every blob
                while (@diff_info_list) {