]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/Add_instructive_commit_messages_for_add__47__edit_pages.mdwn
Change Projects link to point to projects DB
[ikiwiki.git] / doc / todo / Add_instructive_commit_messages_for_add__47__edit_pages.mdwn
1 When I added or edited a page, no commit message was written out (Mercurial backend, though I guess it shouldn't matter). This was done for e.g. the `rename` plugin. I made a naive but seemingly working change to `editpage.pm` to add a message.
2
3 I modeled the message on `rename.pm`, which used a lowercase initial letter and imperative form of the verb. This is not the case for e.g. the `comment` plugin, which says "Added a comment: ", so I guess there is no strict rule on style in this case.
4
5 Diff follows. --[[Daniel Andersson]]
6
7 > This is somewhat intentional. It's pretty usual for changes to be made
8 > to a wiki without bothering to say what changed; the change speaks for
9 > itself and it would just be clutter to mention what file was changed,
10 > since any reasonable interface will show the filename, or a link,
11 > or some summary of what files were affected when showing a change.
12
13 >> I use the Mercurial backend, and Mercurial doesn't allow empty commit messages, so if there were no message, it would default to "no message given" (hardcoded in `mercurial.pm`), which is also clutter, and non-descriptive at that. But I'm on board with your reasoning. It's a matter of taste (and somewhat backend), I guess. I might continue to locally use this patch (with the caveat below fixed when commit message is given), but I won't push for it to be included upstream. --[[Daniel Andersson]]
14
15 >>> Hmm.. It would be possible to make the mercurial backend 
16 >>> include the filename (or just "added" or "edited") in the commit
17 >>> message. It might take some work, especially to handle
18 >>> `rcs_commit_staged`, since it would probably need to cache
19 >>> what files have been staged for commit. --[[Joey]] 
20
21 > Also your patch stomps over any commit message that the user *does*
22 > provide, so certianly cannot be applied as-is. --[[Joey]] 
23
24 >> Yes, "naive" was the word :-) . --[[Daniel Andersson]]
25
26 [[!tag patch]]
27
28 ---
29
30         diff -r ee177ca9bf36 Plugin/editpage.pm
31         --- a/Plugin/editpage.pm        Fri Jul 15 17:58:04 2011 +0200
32         +++ b/Plugin/editpage.pm        Sat Jul 16 03:01:13 2011 +0200
33         @@ -405,6 +405,10 @@
34                         if ($config{rcs}) {
35                                 if (! $exists) {
36                                         rcs_add($file);
37         +                               $message = "add $file";
38         +                       }
39         +                       else {
40         +                               $message = "edit $file";
41                                 }
42          
43                                 # Prevent deadlock with post-commit hook by