Skip to content

Commit

Permalink
Merge branch 'cm/remote-mediawiki'
Browse files Browse the repository at this point in the history
* cm/remote-mediawiki:
  git-remote-mediawiki: display message when launched directly
  • Loading branch information
Junio C Hamano committed Jun 20, 2013
2 parents 50f6909 + 5ada868 commit 0c36f3a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions contrib/mw-to-git/git-remote-mediawiki.perl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
# Used on Git's side to reflect empty edit messages on the wiki
use constant EMPTY_MESSAGE => '*Empty MediaWiki Message*';

if (@ARGV != 2) {
exit_error_usage();
}

my $remotename = $ARGV[0];
my $url = $ARGV[1];

Expand Down Expand Up @@ -157,6 +161,17 @@

########################## Functions ##############################

## error handling
sub exit_error_usage {
die "ERROR: git-remote-mediawiki module was not called with a correct number of\n" .
"parameters\n" .
"You may obtain this error because you attempted to run the git-remote-mediawiki\n" .
"module directly.\n" .
"This module can be used the following way:\n" .
"\tgit clone mediawiki://<address of a mediawiki>\n" .
"Then, use git commit, push and pull as with every normal git repository.\n";
}

# MediaWiki API instance, created lazily.
my $mediawiki;

Expand Down

0 comments on commit 0c36f3a

Please sign in to comment.