git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 04/28] git-remote-mediawiki: Always end a subroutine with a return

From
Célestin Matte <celestin.matte@ensimag.fr>
Date
Jun 9, 2013, 22:22 UTC
Message-ID
<1370816573-3808-5-git-send-email-celestin.matte@ensimag.fr>
In-Reply-To
<1370816573-3808-1-git-send-email-celestin.matte@ensimag.fr>
Follow Subroutines::RequireFinalReturn
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 |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
index 5e198e0..f19b276 100755
--- a/contrib/mw-to-git/git-remote-mediawiki.perl
+++ b/contrib/mw-to-git/git-remote-mediawiki.perl
@@ -197,12 +197,14 @@ sub mw_connect_maybe {
 			exit 1;
 		}
 	}
+	return;
 }
 
 ## Functions for listing pages on the remote wiki
 sub get_mw_tracked_pages {
 	my $pages = shift;
 	get_mw_page_list(\@tracked_pages, $pages);
+	return;
 }
 
 sub get_mw_page_list {
@@ -218,6 +220,7 @@ sub get_mw_page_list {
 		get_mw_first_pages(\@slice, $pages);
 		@some_pages = @some_pages[51..$#some_pages];
 	}
+	return;
 }
 
 sub get_mw_tracked_categories {
@@ -240,6 +243,7 @@ sub get_mw_tracked_categories {
 			$pages->{$page->{title}} = $page;
 		}
 	}
+	return;
 }
 
 sub get_mw_all_pages {
@@ -259,6 +263,7 @@ sub get_mw_all_pages {
 	foreach my $page (@{$mw_pages}) {
 		$pages->{$page->{title}} = $page;
 	}
+	return;
 }
 
 # queries the wiki for a set of pages. Meant to be used within a loop
@@ -289,6 +294,7 @@ sub get_mw_first_pages {
 			$pages->{$page->{title}} = $page;
 		}
 	}
+	return;
 }
 
 # Get the list of pages to be fetched according to configuration.
@@ -357,6 +363,7 @@ sub get_all_mediafiles {
 	foreach my $page (@{$mw_pages}) {
 		$pages->{$page->{title}} = $page;
 	}
+	return;
 }
 
 sub get_linked_mediafiles {
@@ -403,6 +410,7 @@ sub get_linked_mediafiles {
 
 		@titles = @titles[($batch+1)..$#titles];
 	}
+	return;
 }
 
 sub get_mw_mediafile_for_page_revision {
@@ -578,6 +586,7 @@ sub mediawiki_smudge_filename {
 sub literal_data {
 	my ($content) = @_;
 	print STDOUT "data ", bytes::length($content), "\n", $content;
+	return;
 }
 
 sub literal_data_raw {
@@ -588,6 +597,7 @@ sub literal_data_raw {
 	binmode STDOUT, ":raw";
 	print STDOUT "data ", bytes::length($content), "\n", $content;
 	binmode STDOUT, ":encoding(UTF-8)";
+	return;
 }
 
 sub mw_capabilities {
@@ -599,6 +609,7 @@ sub mw_capabilities {
 	print STDOUT "list\n";
 	print STDOUT "push\n";
 	print STDOUT "\n";
+	return;
 }
 
 sub mw_list {
@@ -607,11 +618,13 @@ sub mw_list {
 	print STDOUT "? refs/heads/master\n";
 	print STDOUT "\@refs/heads/master HEAD\n";
 	print STDOUT "\n";
+	return;
 }
 
 sub mw_option {
 	print STDERR "remote-helper command 'option $_[0]' not yet implemented\n";
 	print STDOUT "unsupported\n";
+	return;
 }
 
 sub fetch_mw_revisions_for_page {
@@ -733,6 +746,7 @@ sub import_file_revision {
 	print STDOUT "N inline :$n\n";
 	literal_data("mediawiki_revision: " . $commit{mw_revision});
 	print STDOUT "\n\n";
+	return;
 }
 
 # parse a sequence of
@@ -753,6 +767,7 @@ sub get_more_refs {
 			die("Invalid command in a '$cmd' batch: ". $_);
 		}
 	}
+	return;
 }
 
 sub mw_import {
@@ -762,6 +777,7 @@ sub mw_import {
 		mw_import_ref($ref);
 	}
 	print STDOUT "done\n";
+	return;
 }
 
 sub mw_import_ref {
@@ -805,6 +821,7 @@ sub mw_import_ref {
 		# thrown saying that HEAD is referring to unknown object 0000000000000000000
 		# and the clone fails.
 	}
+	return;
 }
 
 sub mw_import_ref_by_pages {
@@ -1111,6 +1128,7 @@ sub mw_push {
 		print STDERR "  git pull --rebase\n";
 		print STDERR "\n";
 	}
+	return;
 }
 
 sub mw_push_revision {
-- 
1.7.9.5
Previous: Célestin MatteNext: Célestin Matte
Message 5 of 48 in “Follow perlcritic's recommandations”
  1. 00/28 Follow perlcritic's recommandationsCélestin Matte, Jun 9, 2013
  2. 01/28 git-remote-mediawiki: Make a regexp clearerCélestin Matte, Jun 9, 2013
  3. 02/28 git-remote-mediawiki: Move "use warnings;" before any instructionCélestin Matte, Jun 9, 2013
  4. 03/28 git-remote-mediawiki: Replace :utf8 by :encoding(UTF-8)Célestin Matte, Jun 9, 2013
  5. 04/28 git-remote-mediawiki: Always end a subroutine with a returnCélestin Matte, Jun 9, 2013
  6. 05/28 git-remote-mediawiki: Move a variable declaration at the top of the codeCélestin Matte, Jun 9, 2013
  7. 06/28 git-remote-mediawiki: Change syntax of map callsCélestin Matte, Jun 9, 2013
  8. 07/28 git-remote-mediawiki: Rewrite unclear line of instructionsCélestin Matte, Jun 9, 2013
  9. Junio C HamanoJun 11, 2013
  10. Matthieu MoyJun 11, 2013
  11. Junio C HamanoJun 11, 2013
  12. Célestin MatteJun 11, 2013
  13. Junio C HamanoJun 11, 2013
  14. 08/28 git-remote-mediawiki: Remove useless regexp modifier (m)Célestin Matte, Jun 9, 2013
  15. 09/28 git-remote-mediawiki: Change the behaviour of a splitCélestin Matte, Jun 9, 2013
  16. Matthieu MoyJun 10, 2013
  17. 10/28 git-remote-mediawiki: Change separator of some regexpsCélestin Matte, Jun 9, 2013
  18. 11/28 git-remote-mediawiki: Change style in a regexpCélestin Matte, Jun 9, 2013
  19. 12/28 git-remote-mediawiki: Change style in a regexpCélestin Matte, Jun 9, 2013
  20. 13/28 git-remote-mediawiki: Add newline in the end of die() error messagesCélestin Matte, Jun 9, 2013
  21. 14/28 git-remote-mediawiki: Change the name of a variableCélestin Matte, Jun 9, 2013
  22. 15/28 git-remote-mediawiki: Turn double-negated expressions into simple expressionsCélestin Matte, Jun 9, 2013
  23. 16/28 git-remote-mediawiki: Remove unused variable $entryCélestin Matte, Jun 9, 2013
  24. 17/28 git-remote-mediawiki: Rename a variable ($last) which has the name of a keywordCélestin Matte, Jun 9, 2013
  25. 18/28 git-remote-mediawiki: Assign a variable as undef and make proper indentationCélestin Matte, Jun 9, 2013
  26. 19/28 git-remote-mediawiki: Check return value of openCélestin Matte, Jun 9, 2013
  27. 20/28 git-remote-mediawiki: remove import of unused open2Célestin Matte, Jun 9, 2013
  28. 21/28 git-remote-mediawiki: Put long code into a subroutineCélestin Matte, Jun 9, 2013
  29. Junio C HamanoJun 11, 2013
  30. Célestin MatteJun 11, 2013
  31. 22/28 git-remote-mediawiki: Modify strings for a better coding-styleCélestin Matte, Jun 9, 2013
  32. Eric SunshineJun 10, 2013
  33. Célestin MatteJun 10, 2013
  34. Matthieu MoyJun 10, 2013
  35. Célestin MatteJun 10, 2013
  36. Junio C HamanoJun 10, 2013
  37. Benoît PersonJun 10, 2013
  38. Matthieu MoyJun 10, 2013
  39. Junio C HamanoJun 10, 2013
  40. 23/28 git-remote-mediawiki: Brace file handles for print for more clarityCélestin Matte, Jun 9, 2013
  41. 24/28 git-remote-mediawiki: Replace "unless" statements with negated "if" statementsCélestin Matte, Jun 9, 2013
  42. 25/28 git-remote-mediawiki: Don't use quotes for empty stringsCélestin Matte, Jun 9, 2013
  43. 26/28 git-remote-mediawiki: Put non-trivial numeric values in constants.Célestin Matte, Jun 9, 2013
  44. 27/28 git-remote-mediawiki: Fix a typo ("mediwiki" instead of "mediawiki")Célestin Matte, Jun 9, 2013
  45. 28/28 git-remote-mediawiki: Clearly rewrite double dereferenceCélestin Matte, Jun 9, 2013
  46. Eric SunshineJun 10, 2013
  47. Matthieu MoyJun 10, 2013
  48. Célestin MatteJun 11, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.