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 14:12:33 +0200
User-agent: Mutt/1.5.16 OpenPKG/CURRENT (2007-06-09)

On Sun, Sep 23, 2007, Ralf S. Engelschall wrote:

> On Sat, Sep 22, 2007, Timothy Brownawell wrote:
>
> > On Sat, 2007-09-22 at 22:25 -0600, Pablo Delgado wrote:
> >
> > > Someone recommended that I started working on something that I feel
> > > bothers me or I need. Well, one of thing I miss is the commit
> > > templating capability that cvs has. This feature allows the repository
> > > manager or project leader to establish the basic structure of the
> > > commit message that they wish to use for their project.
> >
> > > 1) What does everyone think of this idea?
> >
> > Yes. I'm surprised we don't have this yet, I know it was discussed
> > before and I don't recall any objections.
> >
> > > 2) Should a template file be stored in _MTN maybe call template?
> > > 3) Should the template be stored in the DB, so that all developers
> > > that work on a specific project gets the wanted template when
> > > performing a commit?
> >
> > It should probably be in the project root like .mtn-ignore is.
>
> Yes, I also recommend to use something like a .mtn-message (or whatever
> it is named) as this way it automatically becomes part of the DB (so
> all developers have it) and can be versioned, too. And on "mtn ci" let
> Monotone search for those files in all directories (current and parents)
> up to the workspace root directory.

Searching the parent dirs might be not the best idea.
For the remaining functionality the following does the trick for me:

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?

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





reply via email to

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