threads / discuss / 59232

Suggestion and question about hooks

Subject: Suggestion and question about hooks

## tl;dr

2 messages between Feb 12, 2023 and Feb 12, 2023.

replies: 1people: 2as markdown or json

Junio C Hamano· Feb 12, 2023, 23:40 UTC · re: Renato Ramos Ribeiro Araujo · lore

Re: Suggestion and question about hooks

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.

← back to recent threads