git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Célestin Matte" <celestin.matte@ensimag.fr>
To: git@vger.kernel.org
Cc: benoit.person@ensimag.fr, matthieu.moy@grenoble-inp.fr,
	"Célestin Matte" <celestin.matte@ensimag.fr>
Subject: [PATCH 03/18] Add newline in the end of die() error messages
Date: Thu,  6 Jun 2013 21:34:08 +0200	[thread overview]
Message-ID: <1370547263-13558-4-git-send-email-celestin.matte@ensimag.fr> (raw)
In-Reply-To: <1370547263-13558-1-git-send-email-celestin.matte@ensimag.fr>

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
---
 contrib/mw-to-git/git-remote-mediawiki.perl |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
index 482cd95..4baad95 100755
--- a/contrib/mw-to-git/git-remote-mediawiki.perl
+++ b/contrib/mw-to-git/git-remote-mediawiki.perl
@@ -136,16 +136,16 @@ while (<STDIN>) {
 	if (defined($cmd[0])) {
 		# Line not blank
 		if ($cmd[0] eq "capabilities") {
-			die("Too many arguments for capabilities") unless (!defined($cmd[1]));
+			die("Too many arguments for capabilities\n") unless (!defined($cmd[1]));
 			mw_capabilities();
 		} elsif ($cmd[0] eq "list") {
-			die("Too many arguments for list") unless (!defined($cmd[2]));
+			die("Too many arguments for list\n") unless (!defined($cmd[2]));
 			mw_list($cmd[1]);
 		} elsif ($cmd[0] eq "import") {
-			die("Invalid arguments for import") unless ($cmd[1] ne "" && !defined($cmd[2]));
+			die("Invalid arguments for import\n") unless ($cmd[1] ne "" && !defined($cmd[2]));
 			mw_import($cmd[1]);
 		} elsif ($cmd[0] eq "option") {
-			die("Too many arguments for option") unless ($cmd[1] ne "" && $cmd[2] ne "" && !defined($cmd[3]));
+			die("Too many arguments for option\n") unless ($cmd[1] ne "" && $cmd[2] ne "" && !defined($cmd[3]));
 			mw_option($cmd[1],$cmd[2]);
 		} elsif ($cmd[0] eq "push") {
 			mw_push($cmd[1]);
@@ -242,7 +242,7 @@ sub get_mw_tracked_categories {
 			cmtitle => $category,
 			cmlimit => 'max' } )
 			|| die $mediawiki->{error}->{code} . ': '
-				. $mediawiki->{error}->{details};
+				. $mediawiki->{error}->{details} . "\n";
 		foreach my $page (@{$mw_pages}) {
 			$pages->{$page->{title}} = $page;
 		}
@@ -767,7 +767,7 @@ sub get_more_refs {
 		} elsif ($line eq "\n") {
 			return @refs;
 		} else {
-			die("Invalid command in a '$cmd' batch: ". $_);
+			die("Invalid command in a '$cmd' batch: $_\n");
 		}
 	}
 	return;
@@ -879,7 +879,7 @@ sub mw_import_revids {
 		my $result = $mediawiki->api($query);
 
 		if (!$result) {
-			die "Failed to retrieve modified page for revision $pagerevid";
+			die "Failed to retrieve modified page for revision $pagerevid\n";
 		}
 
 		if (defined($result->{query}->{badrevids}->{$pagerevid})) {
@@ -888,7 +888,7 @@ sub mw_import_revids {
 		}
 
 		if (!defined($result->{query}->{pages})) {
-			die "Invalid revision $pagerevid.";
+			die "Invalid revision $pagerevid.\n";
 		}
 
 		my @result_pages = values(%{$result->{query}->{pages}});
@@ -999,7 +999,7 @@ sub mw_upload_file {
 			}, {
 				skip_encoding => 1
 			} ) || die $mediawiki->{error}->{code} . ':'
-				 . $mediawiki->{error}->{details};
+				 . $mediawiki->{error}->{details} . "\n";
 			my $last_file_page = $mediawiki->get_page({title => $path});
 			$newrevid = $last_file_page->{revid};
 			print STDERR "Pushed file: $new_sha1 - $complete_file_name.\n";
@@ -1079,7 +1079,7 @@ sub mw_push_file {
 				# Other errors. Shouldn't happen => just die()
 				die 'Fatal: Error ' .
 				    $mediawiki->{error}->{code} .
-				    ' from mediwiki: ' . $mediawiki->{error}->{details};
+				    ' from mediwiki: ' . $mediawiki->{error}->{details} . "\n";
 			}
 		}
 		$newrevid = $result->{edit}->{newrevid};
@@ -1101,7 +1101,7 @@ sub mw_push {
 	my $pushed;
 	for my $refspec (@refsspecs) {
 		my ($force, $local, $remote) = $refspec =~ /^(\+)?([^:]*):([^:]*)$/
-		    or die("Invalid refspec for push. Expected <src>:<dst> or +<src>:<dst>");
+		    or die("Invalid refspec for push. Expected <src>:<dst> or +<src>:<dst>\n");
 		if ($force) {
 			print STDERR "Warning: forced push not allowed on a MediaWiki.\n";
 		}
@@ -1173,7 +1173,7 @@ sub mw_push_revision {
 					$local_ancestry{$parent} = $child;
 				}
 			} elsif (!$line =~ /^([a-f0-9]+)/) {
-				die "Unexpected output from git rev-list: $line";
+				die "Unexpected output from git rev-list: $line\n";
 			}
 		}
 		while ($parsed_sha1 ne $HEAD_sha1) {
@@ -1227,7 +1227,7 @@ sub mw_push_revision {
 				return error_non_fast_forward($remote);
 			}
 			if ($status ne "ok") {
-				die("Unknown error from mw_push_file()");
+				die("Unknown error from mw_push_file()\n");
 			}
 		}
 		unless ($dumb_push) {
-- 
1.7.9.5

  parent reply	other threads:[~2013-06-06 19:35 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 19:34 [PATCH 00/18] git-remote-mediawiki: Follow perlcritic's recommandations Célestin Matte
2013-06-06 19:34 ` [PATCH 01/18] Follow perlcritic's recommendations - level 5 and 4 Célestin Matte
2013-06-07  1:42   ` Eric Sunshine
2013-06-07  8:10   ` Matthieu Moy
2013-06-07 12:11     ` Célestin Matte
2013-06-07 17:43       ` Matthieu Moy
2013-06-06 19:34 ` [PATCH 02/18] Change style of some regular expressions to make them clearer Célestin Matte
2013-06-07  1:54   ` Eric Sunshine
2013-06-07  2:30     ` Junio C Hamano
2013-06-07  4:39       ` Eric Sunshine
2013-06-07  4:51         ` Junio C Hamano
2013-06-07 10:40   ` Peter Krefting
2013-06-06 19:34 ` Célestin Matte [this message]
2013-06-06 19:34 ` [PATCH 04/18] Prevent local variable $url to have the same name as a global variable Célestin Matte
2013-06-06 19:34 ` [PATCH 05/18] Turn double-negated expressions into simple expressions Célestin Matte
2013-06-07  4:12   ` Eric Sunshine
2013-06-07 17:04     ` Célestin Matte
2013-06-07 20:25       ` Eric Sunshine
2013-06-07 20:32         ` Célestin Matte
2013-06-06 19:34 ` [PATCH 06/18] Remove unused variable Célestin Matte
2013-06-06 19:34 ` [PATCH 07/18] Rename a variable ($last) so that it does not have the name of a keyword Célestin Matte
2013-06-06 19:34 ` [PATCH 08/18] Explicitely assign local variable as undef and make a proper one-instruction-by- line indentation Célestin Matte
2013-06-07  1:19   ` Eric Sunshine
2013-06-07  8:18   ` Matthieu Moy
2013-06-06 19:34 ` [PATCH 09/18] Check return value of open and remove import of unused open2 Célestin Matte
2013-06-07  8:21   ` Matthieu Moy
2013-06-06 19:34 ` [PATCH 10/18] Put long code into a submodule Célestin Matte
2013-06-07  4:01   ` Eric Sunshine
2013-06-07  4:51     ` Junio C Hamano
2013-06-06 19:34 ` [PATCH 11/18] Modify strings for a better coding-style Célestin Matte
2013-06-07  4:31   ` Eric Sunshine
2013-06-06 19:34 ` [PATCH 12/18] Brace file handles for print for more clarity Célestin Matte
2013-06-06 19:34 ` [PATCH 13/18] Remove "unless" statements and replace them by negated "if" statements Célestin Matte
2013-06-07  3:41   ` Eric Sunshine
2013-06-06 19:34 ` [PATCH 14/18] Don't use quotes for empty strings Célestin Matte
2013-06-06 19:34 ` [PATCH 15/18] Put non-trivial numeric values (e.g., different from 0, 1 and 2) in constants Célestin Matte
2013-06-06 19:34 ` [PATCH 16/18] Fix a typo ("mediwiki" instead of "mediawiki") Célestin Matte
2013-06-06 19:34 ` [PATCH 17/18] Place the open() call inside the do{} struct and prevent failing close Célestin Matte
2013-06-06 21:13   ` Junio C Hamano
2013-06-06 21:30     ` Célestin Matte
2013-06-06 21:58       ` Junio C Hamano
2013-06-06 22:16         ` Célestin Matte
2013-06-06 19:34 ` [PATCH 18/18] Clearly rewrite double dereference Célestin Matte
2013-06-07  4:04   ` Eric Sunshine

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=1370547263-13558-4-git-send-email-celestin.matte@ensimag.fr \
    --to=celestin.matte@ensimag.fr \
    --cc=benoit.person@ensimag.fr \
    --cc=git@vger.kernel.org \
    --cc=matthieu.moy@grenoble-inp.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).