gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] Re: Re: Having two precommit hooks


From: Stephen J. Turnbull
Subject: Re: [Gnu-arch-users] Re: Re: Having two precommit hooks
Date: Tue, 12 Oct 2004 10:16:48 +0900
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (chayote, linux)

>>>>> "Thomas" == Thomas Lord <address@hidden> writes:

    Thomas> ? The (made up here) guiding principle being that hooks
    Thomas> named after commands are called after the command
    Thomas> completes ("commit") and that the last hook called before
    Thomas> beginning an archive transaction is the command name
    Thomas> prefixed with "pre" ("precommit"), and that if the command
    Thomas> operates on a tree and we want a hook that gets first-shot
    Thomas> on that tree, that's "prepare-" followed by the command
    Thomas> name.

I think that's clear enough, and the names are not inconsistent with
the semantics.  Just make sure the principle is clearly and obviously
documented, and honored in the observance, not the breach. ;-)

Emacs hooks don't seem to have such a rule; some hooks that are named
after a command are done before the command executes, some after.  But
many commands that change state in an irreversible way (kill-emacs,
write-file) have hooks that are called _before_ the command, so they
can do checking, modify the semantics, etc.  I suspect that Emacs
users might tend to expect the commit hook to be called _before_ the
archive transaction is started.  Not a good reason to oppose your
proposal principle, but a good reason to document it. :-)

-- 
Institute of Policy and Planning Sciences     http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.




reply via email to

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