# Suggestion and question about hooks

2 messages from 2023-02-12 to 2023-02-12. Participants: Renato Ramos Ribeiro Araujo, Junio C Hamano.
Thread: https://gitlist.dev/t/59232

## Renato Ramos Ribeiro Araujo, 2023-02-12 18:09

Subject: Suggestion and question about hooks
Message-ID: <Y+krdsIPhKIxFRHt@zosoarch>
URL: https://gitlist.dev/e/Y%2BkrdsIPhKIxFRHt%40zosoarch

```
Why git does not have a hook 'post-push'?

```

## Junio C Hamano, 2023-02-12 23:40

Subject: Re: Suggestion and question about hooks
Message-ID: <xmqqzg9icv0u.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqzg9icv0u.fsf%40gitster.g
In-Reply-To: <Y+krdsIPhKIxFRHt@zosoarch>

```
Renato Ramos Ribeiro Araujo <renatorraraujo@gmail.com> writes:

> Why git does not have a hook 'post-push'?

You may want to look for "(five) valid reasons to have hook" in the
list archive.

It depends on what it does, but if it always runs after user does
"git push", or it always runs if "git push" finishes without an
error, then such a customization does not deserve to be a hook.

	$ cat >$HOME/bin/git-mypush <<-\EOF
	#!/bin/sh
	git push "$@" && {
		... write whatever your post-push would do here ...
	}
	EOF

would work just fine without any change to git itself.

```
