git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: git@vger.kernel.org, gitster@pobox.com
Cc: Pavel.Volek@ensimag.imag.fr, Kim-Thuat.Nguyen@ensimag.imag.fr,
	roucherj@ensimag.imag.fr, Matthieu Moy <Matthieu.Moy@imag.fr>
Subject: [PATCH 1/5] git-remote-mediawiki: don't compute the diff when getting commit message
Date: Wed, 27 Jun 2012 11:10:16 +0200	[thread overview]
Message-ID: <1340788220-10084-2-git-send-email-Matthieu.Moy@imag.fr> (raw)
In-Reply-To: <1340788220-10084-1-git-send-email-Matthieu.Moy@imag.fr>

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 <Matthieu.Moy@imag.fr>
---
 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

  reply	other threads:[~2012-06-27  9:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26 16:04 [PATCH 0/5] git-remote-mediawiki: support File: import and export Matthieu Moy
2012-06-26 16:04 ` [PATCH 1/5] git-remote-mediawiki: don't compute the diff when getting commit message Matthieu Moy
2012-06-26 17:47   ` Junio C Hamano
2012-06-27  8:32     ` Matthieu Moy
2012-06-26 16:04 ` [PATCH 2/5] git-remote-mediawiki: don't "use encoding 'utf8';" Matthieu Moy
2012-06-26 16:04 ` [PATCH 3/5] git-remote-mediawiki: send "File:" attachments to a remote wiki Matthieu Moy
2012-06-26 16:04 ` [PATCH 4/5] git-remote-mediawiki: split get_mw_pages into smaller functions Matthieu Moy
2012-06-26 16:04 ` [PATCH 5/5] git-remote-mediawiki: import "File:" attachments Matthieu Moy
2012-06-27  9:10 ` [PATCH 0/5 v2] git-remote-mediawiki: support File: import and export Matthieu Moy
2012-06-27  9:10   ` Matthieu Moy [this message]
2012-06-27  9:10   ` [PATCH 2/5] git-remote-mediawiki: don't "use encoding 'utf8';" Matthieu Moy
2012-06-27  9:10   ` [PATCH 3/5] git-remote-mediawiki: send "File:" attachments to a remote wiki Matthieu Moy
2012-06-27  9:10   ` [PATCH 4/5] git-remote-mediawiki: split get_mw_pages into smaller functions Matthieu Moy
2012-06-27  9:10   ` [PATCH 5/5] git-remote-mediawiki: import "File:" attachments Matthieu Moy
2012-06-27 14:21     ` [PATCH 5/5 v3] " Matthieu Moy
2012-07-04 12:53       ` [PATCH v4] " Matthieu Moy
2012-07-05  6:58         ` Junio C Hamano
2012-07-05  7:42           ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340788220-10084-2-git-send-email-Matthieu.Moy@imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=Kim-Thuat.Nguyen@ensimag.imag.fr \
    --cc=Pavel.Volek@ensimag.imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=roucherj@ensimag.imag.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).