From: Pang Yan Han <pangyanhan@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
"Shawn O. Pearce" <spearce@spearce.org>,
Jeff King <peff@peff.net>, Sitaram Chamarty <sitaramc@gmail.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Pang Yan Han <pangyanhan@gmail.com>
Subject: [PATCH/RFC 0/2] Teach receive-pack not to run update hook for corrupt/non existent ref
Date: Sun, 25 Sep 2011 13:06:20 +0800 [thread overview]
Message-ID: <1316927182-14212-1-git-send-email-pangyanhan@gmail.com> (raw)
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
next reply other threads:[~2011-09-25 5:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-25 5:06 Pang Yan Han [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1316927182-14212-1-git-send-email-pangyanhan@gmail.com \
--to=pangyanhan@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=sitaramc@gmail.com \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).