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

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

Re: [Gnu-arch-users] Re: Precommit hooks?


From: Tom Lord
Subject: Re: [Gnu-arch-users] Re: Precommit hooks?
Date: Sat, 3 Apr 2004 11:17:00 -0800 (PST)

    > From: Jonathan Daugherty <address@hidden>

    > # All hooks are pre- .  The "commit" hook is documented.

    > Their point is that whether it is pre- or post- is what is
    > undocumented:

    > "Each time that arch performs a command that modifies an archive, arch
    > will attempt to run ~/.arch-params/hook, which must be set as
    > executable."

    > Also, how is that the hook is run before command is run?  My hook
    > script runs "tla changelog" against the archive whenever I run a
    > commit, and the results are always correct; I am led to think, then,
    > that the hook is run after the command.

There seems to be confusion.

There are _two_ hooks:  `precommit' and `commit'.

`precommit' is run _before_ the commit.   `tla changelog' will not
include an entry for the thing being committed (however, it's a simple
matter to patch tla to make a precognizent changelog available).

The exit status of the `precommit' hook is significant.   A non-0
status will abort teh commit.   It was created for just the sort
application that sparked this thread --- pre-commit testing.

`commit' is run _after_ commit.   `tla changelog' will include the
just-committed entry.  The exit status is not significant.

Sorry the docs aren't quite up to snuff here but, for work-around
reference, you can always grep in src/tla/libarch/*.c for
`arch_run_hook'.

(It is not true that "all hooks are pre-".)

-t






reply via email to

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