Re: [PATCH 2/8] git-remote-mediawiki: actually send empty comment when they're empty
From: Matthieu Moy <hidden>
Date: 2016-06-15 22:54:16
Junio C Hamano [off-list ref] writes:
Matthieu Moy [off-list ref] writes:quoted
Signed-off-by: Matthieu Moy <redacted> --- contrib/mw-to-git/git-remote-mediawiki | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)diff --git a/contrib/mw-to-git/git-remote-mediawiki b/contrib/mw-to-git/git-remote-mediawiki index a6ad8cf..a2da52f 100755 --- a/contrib/mw-to-git/git-remote-mediawiki +++ b/contrib/mw-to-git/git-remote-mediawiki@@ -51,6 +51,9 @@ use constant EMPTY_CONTENT => "<!-- empty page -->\n"; # used to reflect file creation or deletion in diff. use constant NULL_SHA1 => "0000000000000000000000000000000000000000"; +# Used on Git's side to reflect empty edit messages on the wiki +use constant EMPTY_MESSAGE => '*Empty MediaWiki Message*'; +Is there a reason why this sentinel value cannot be a real empty string?
That would mean having an empty commit message on the Git side, which is against the use (although possible with fast-import). The import turns empty mediawiki messages (which are very common in my experience) into this string to provide a nicer-looking history. It's not like EMPTY_CONTENT, which is explicitely forbidden on the MediaWiki side, hence really cannot be the empty string. Ideally, EMPTY_MESSAGE could be configurable, and the empty string could be an acceptable value to make this conversion optional. (note that the string was already there, my patch only makes it a constant to be able to use it in two distinct places). -- Matthieu Moy http://www-verimag.imag.fr/~moy/