monotone-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Re: [Monotone-devel] .mt-template implementation


From: Nathaniel Smith
Subject: Re: [PATCH] Re: [Monotone-devel] .mt-template implementation
Date: Tue, 20 Sep 2005 12:39:15 -0700
User-agent: Mutt/1.5.9i

On Wed, Sep 21, 2005 at 01:37:35AM +1000, Badai Aqrandista wrote:
> 
> Hi,
> 
> This is a patch to use .mt-template as MT/log's template.
> 
> Any comments?

Looks very nice!  Just a few small requests:

-      N(log_message.find_first_not_of(" \r\t\n") != string::npos,
-        F("empty log message; commit canceled"));
+
+      if (does_exist_user_log_tmpl())
+        {
+          data user_log_tmpl;
+          read_user_log_tmpl(user_log_tmpl);
+          N(user_log_tmpl() != log_message,
+            F("log message is the same as .mt-template; commit cancelled"));
+        }
+      else
+        N(log_message.find_first_not_of(" \r\t\n") != string::npos,
+          F("empty log message; commit canceled"));
+
^^ Can we factor this logic out into a function?

Also, the 'else' should be removed -- we should always cancel if the
log message is empty, even if there is a template.  (People have
gotten used to actively canceling a commit by deleting all the text in
their editor window.)

There's a typo in "cancelled", should be "canceled".

The does_exist_user_log_tmpl is redundant, actually... everywhere it's
used, we could just use read_user_log_tmpl unconditionally (since
read_user_log_tmpl is designed to do nothing if the file doesn't
exist).

We need doc (monotone.texi) and test (tests/README) updates for this.

Thanks!
-- Nathaniel

-- 
"...these, like all words, have single, decontextualized meanings: everyone
knows what each of these words means, everyone knows what constitutes an
instance of each of their referents.  Language is fixed.  Meaning is
certain.  Santa Claus comes down the chimney at midnight on December 24."
  -- The Language War, Robin Lakoff




reply via email to

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