git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC 0/2] Teach receive-pack not to run update hook for corrupt/non existent ref
@ 2011-09-25  5:06 Pang Yan Han
  2011-09-25  5:06 ` [PATCH/RFC 1/2] is_url: Remove redundant assignment Pang Yan Han
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Pang Yan Han @ 2011-09-25  5:06 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Shawn O. Pearce, Jeff King, Sitaram Chamarty,
	Johannes Schindelin, Pang Yan Han

Hi list,

Currently, receive-pack runs the pre-receive, update, post-receive and
post-update hooks during a push to delete corrupt or non-existent refs, eg:

	git push origin :refs/heads/foo

where refs/heads/foo is missing from the remote origin.

The issue is reported here [1]


This is a patch series which teaches receive-pack not to run update hook for
corrupt or non existent refs during a push.

Patch 1/2 isn't really relevant to the topic. It's just something I stumbled
across while reading the code. It removes a redundant assignment in the is_url
function.

Patch 2/2 teaches receive-pack not to run update hook for corrupt or non
existent refs. In summary, I reordered the statements in the update function
so that the update hook is not run for corrupt / non existent refs.

Perhaps this isn't a good enough solution since the pre-receive, post-receive
and post-update hooks are still run. Also the tests aren't exactly good looking.

Any advice is highly appreciated. Thanks!

[1] http://thread.gmane.org/gmane.comp.version-control.git/181942 

Pang Yan Han (2):
  is_url: Remove redundant assignment
  receive-pack: Don't run update hook for corrupt or nonexistent ref

 builtin/receive-pack.c |   50 +++++++++++++++++++++++++++--------------------
 t/t5516-fetch-push.sh  |   33 +++++++++++++++++++++++++++++++
 url.c                  |    1 -
 3 files changed, 62 insertions(+), 22 deletions(-)

-- 
1.7.7.rc3.2.g29f2e6

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2011-09-27 22:58 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-25  5:06 [PATCH/RFC 0/2] Teach receive-pack not to run update hook for corrupt/non existent ref Pang Yan Han
2011-09-25  5:06 ` [PATCH/RFC 1/2] is_url: Remove redundant assignment Pang Yan Han
2011-09-25  9:26   ` Tay Ray Chuan
2011-09-26 16:52     ` Junio C Hamano
2011-09-26 21:32       ` Jeff King
2011-09-25  5:06 ` [PATCH/RFC 2/2] receive-pack: Don't run update hook for corrupt or nonexistent ref Pang Yan Han
2011-09-25 17:37   ` [PATCH/RFCv2 2/2] run post-receive and post-update hooks with empty stdin/no args for invalid ref deletion Pang Yan Han
2011-09-25  7:58 ` [PATCH/RFC 0/2] Teach receive-pack not to run update hook for corrupt/non existent ref Sitaram Chamarty
2011-09-25  9:48   ` Pang Yan Han
2011-09-25 12:05     ` Sitaram Chamarty
2011-09-26 23:23       ` Junio C Hamano
2011-09-26 23:44         ` Sitaram Chamarty
2011-09-26 23:49           ` Junio C Hamano
2011-09-27  0:04             ` Junio C Hamano
2011-09-27  9:02               ` Pang Yan Han
2011-09-27 16:56                 ` Junio C Hamano
2011-09-27 22:55                   ` Pang Yan Han
2011-09-27  0:05             ` Sitaram Chamarty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).