Re: [PATCH 2/8] git-remote-mediawiki: actually send empty comment when they're empty
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jul 16, 2012, 19:06 UTC
- Message-ID
- <vpqr4sbv83q.fsf@bauges.imag.fr>
- In-Reply-To
- <7vd33v377x.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 21 quoted lines
> Matthieu Moy <Matthieu.Moy@imag.fr> writes: > >> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> >> --- >> 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/