git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Suggestion and question about hooks

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 12, 2023, 23:40 UTC
Message-ID
<xmqqzg9icv0u.fsf@gitster.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.
Previous: Renato Ramos Ribeiro Araujo
Message 2 of 2 in “Suggestion and question about hooks”
  1. Renato Ramos Ribeiro AraujoFeb 12, 2023
  2. Junio C HamanoFeb 12, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.