monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] [PATCH] _MTN/log pre-specified magic line quickie


From: Ben Walton
Subject: Re: [Monotone-devel] [PATCH] _MTN/log pre-specified magic line quickie
Date: Fri, 15 Dec 2006 19:40:52 -0500

I believe the attached patch fixes the broken test cases for the magic
line patch.

It looks like the wrong mkdir patch may have been applied to the tree
also, causing that test to fail.  I submitted two attempts at that
patch (the first not including the tests...before morning coffee).
The second one included the tests and should work.

As for the api surrounding the edit_comment hook, could a user wanting
to override the hook not just strip the line in their localized text?
I may be missing something here?

Thanks
-Ben

On 12/15/06, Nathaniel J. Smith <address@hidden> wrote:
On Fri, Dec 15, 2006 at 08:57:36AM -0500, Ben Walton wrote:
> I actually looked at implementing this inside the hook, but chose the
> c++ route for the following reason.  I may be off base here with my
> reasoning, so let me know if you agree/disagree:
>
> Doing this in the c++ code leaves a hook writer the responsiblity of
> explicitly removing the 'magic' line if they wish to disable the
> feature.  Implementing this in the lua hook leaves the hook writer the
> implicit resposibility of providing the feature if they override the
> hook.  Now in reality, the difference is small.  I just felt that from
> a UI perspective, it's better to make a user responsible for explicit
> rather than implicit actions.

I see your point.  I was thinking more in terms of usable apis, it's
actually really hard for a hook to programmatically detect the "magic"
line and remove it, once it is mixed in with the rest of comment.  I'm
not sure how one would actually do this (especially keeping in mind
that we may change the phrasing, the string may occur in translated
form, etc.).

I think the bottom line is that it doesn't actually matter that much,
the commit message hook stuff is a bit of a mess anyway, there are
already things like the C++ generates the message about lines with
"MTN:" in front being removed, but it's the hook that actually defines
the MTN: prefixing/removal mechanism, etc... so basically, I would
just go with whatever is easiest.

-- Nathaniel



--
---------------------------------------------------------------------------------------------------------------------------
Ben Walton <address@hidden>

Unanswered questions are far less dangerous than unquestioned answers.
- The Roadside Pulpit
---------------------------------------------------------------------------------------------------------------------------

Attachment: fix_tests_after_magic_line.patch
Description: Text Data


reply via email to

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