monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Monotone Commit Template


From: Ralf S. Engelschall
Subject: Re: [Monotone-devel] Monotone Commit Template
Date: Sun, 23 Sep 2007 18:45:14 +0200
User-agent: Mutt/1.5.16 OpenPKG/CURRENT (2007-06-09)

On Sun, Sep 23, 2007, Nathaniel Smith wrote:

> On Sun, Sep 23, 2007 at 02:12:33PM +0200, Ralf S. Engelschall wrote:
> > Index: std_hooks.lua
> > --- std_hooks.lua   6ca29b67a6913342668b4cfa2464a37654615280
> > +++ std_hooks.lua   3852a7038c60e2389b3d1438906439794999d443
> > @@ -271,6 +271,13 @@ function edit_comment(basetext, user_log
> >     if user_log_message == "" or string.sub(user_log_message, -1) ~= "\n" 
> > then
> >        tmp:write("\n")
> >     end
> > +   local template_log_message = read_contents_of_file(".mtn-message", "r")
> > +   if template_log_message ~= nil then
> > +      tmp:write(template_log_message)
> > +      if template_log_message == "" or string.sub(template_log_message, 
> > -1) ~= "\n" then
> > +         tmp:write("\n")
> > +      end
> > +   end
> >     tmp:write(basetext)
> >     io.close(tmp)
> >
> > Should we commit such a change or do we need a more sophisticated solution?
>
> This is broken, unfortunately -- e.g., if the user starts a commit,
> aborts it, then tries again, they will end up with multiple copies of
> the template in their log message.

Really? I tried it multiple times and I aborted by just using ":q!"
from Vim and I never have seen the message accumulating. It worked just
fine. The Lua function intentionally just copies .mtn-message into the
_temporary_ file, not into _MTN/log.

> [...]
> What charset should .mtn-message be interpreted to be in, current user
> preferred charset or always-utf8?  Always-utf8 seems more viable,
> though I'm sure it will bite someone at some point.

Can we control this in the Lua hook at all?

                                       Ralf S. Engelschall
                                       address@hidden
                                       www.engelschall.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]