Why isn't there a hook for all operations that update the working tree?

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Why isn't there a hook for all operations that update the working tree?

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:51:40

I have a repository where I'd like to run a program every time the
working tree is updated. githooks(5) specifies that you can use
post-{checkout,merge} hooks to hook into those two operations.

However that doesn't catch e.g. "git reset --hard". Is there any
reason beside omission that there isn't a post-reset hook? Or hooks
for any other thing (most of which surely slip my mind) which can
update the working tree?

Re: Why isn't there a hook for all operations that update the working tree?

From: Neal Kreitzinger <hidden>
Date: 2016-06-15 22:51:44

On 7/28/2011 6:59 AM, Ævar Arnfjörð Bjarmason wrote:
I have a repository where I'd like to run a program every time the
working tree is updated. githooks(5) specifies that you can use
post-{checkout,merge} hooks to hook into those two operations.

However that doesn't catch e.g. "git reset --hard". Is there any
reason beside omission that there isn't a post-reset hook? Or hooks
for any other thing (most of which surely slip my mind) which can
update the working tree?
You could create an alias like "git resetr" that runs the script.

v/r,
neal
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help