]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/Webedits_without_comment_don__39__t_make_it_through_git.mdwn
already fixed
[ikiwiki.git] / doc / bugs / Webedits_without_comment_don__39__t_make_it_through_git.mdwn
1 If you edit via web, and don't enter a comment, the commit message for the ensuing Git commit is empty.  Git by default will not commit with a blank commit message, so the edited file is still there in the working files for Ikiwiki but not committed into Git.
2
3 A subsequent commit (including another web page edit with comments) will pull this change in with any new editing.  We found this by having spam edits suddenly appear on various pages with no corresponding commits to match.
4
5 IkiWiki/plugin/git.pm checks for a version of git greater than 1.5.4, and if greater, commits with a blank message and '--cleanup=verbatim'.  The cleanup option doesn't let the message get committed.  Relatively new versions of git support '--allow-empty-message' but I haven't been able to identify when that feature was added.  Instead I opted for a default message.
6
7     544,545d543
8     <   # git will not commit with a blank comment, though this 
9     <   # can be overridden in later versions.  
10     547c545,553
11     <           $params{message}.="No commit message specified.";
12     ---
13     >           # Force git to allow empty commit messages.
14     >           # (If this version of git supports it.)
15     >           my ($version)=`git --version` =~ /git version (.*)/;
16     >           if ($version ge "1.5.4") {
17     >                   push @opts, '--cleanup=verbatim';
18     >           }
19     >           else {
20     >                   $params{message}.=".";
21     >           }
22
23 The other option would be to change only line 549:
24
25     push @opts, '--cleanup=verbatim';
26
27 to
28
29     push @opts, '--allow-empty-message';
30
31 [[!tag  bugs patch]]
32
33 > This is already [[fixed|done]] since 3.20130711. git versions since 1.7.2
34 > are affected. Here's the commit if you want to backport it:
35 > [[b162563|http://source.ikiwiki.branchable.com/?p=source.git;a=commitdiff;h=b162563dc1c6126953e66cdcc508f389b9d39d8e]].
36 >
37 > As a general comment on synthesizing commit messages, I personally don't
38 > think ikiwiki should invent an untranslated English commit message
39 > if the user didn't provide one - using an obviously trivial commit message,
40 > ".", seems more honest. OTOH, the `bzr` and `mercurial` plugins both use
41 > an untranslated "no message given", and `darcs` uses "empty message".
42 > It should either consistently use ".", or consistently use gettext(x)
43 > for some standardized value of x, perhaps "no message given". Joey,
44 > any preference?
45 >
46 > The other RCS plugins (`cvs`, `svn`, `tla`) never need to deal with an
47 > empty commit message because they prepend something like "web commit
48 > from smcv", so the message can never be empty.
49 >
50 > --[[smcv]]