Thread (14 messages) flat view 14 messages, 1 author, 2016-06-15
STALE3736d

Revision v2 of 2 in this series.

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH 1/5] git-remote-mediawiki: don't compute the diff when getting commit message

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:54:11
Subsystem: the rest · Maintainer: Linus Torvalds

While we're there, simplify the code a bit: since log --format=%s anyway
shows the subject line as a single line, no need to split to take the
first line.

Signed-off-by: Matthieu Moy <redacted>
---
 contrib/mw-to-git/git-remote-mediawiki | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/mw-to-git/git-remote-mediawiki b/contrib/mw-to-git/git-remote-mediawiki
index a34f53f..781dfe2 100755
--- a/contrib/mw-to-git/git-remote-mediawiki
+++ b/contrib/mw-to-git/git-remote-mediawiki
@@ -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) {
-- 
1.7.11.5.g0c7e058.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help