]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/Webedits_without_comment_don__39__t_make_it_through_git.mdwn
421315b93c0d1ae4b78b7408dfdc1d7c69e96a5b
[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]]