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

Re: [PATCH/RFC 0/2] Teach receive-pack not to run update hook for corrupt/non existent ref

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Sep 25, 2011, 07:58 UTC
Message-ID
<CAMK1S_hadzaqixaW3Fx81pf=hVsvAMpVvVGqVtZ8ncfUsie_9w@mail.gmail.com>
In-Reply-To
<1316927182-14212-1-git-send-email-pangyanhan@gmail.com>
On Sun, Sep 25, 2011 at 10:36 AM, Pang Yan Han <pangyanhan@gmail.com> wrote:
Show 10 quoted lines
> 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]

I did not report an issue. I asked if this was expected and could be relied upon. I'm actually happy with the current behaviour because it solves a problem very neatly for me, but before documenting it I wanted to make sure it would not one day disappear.

Show 13 quoted lines
> 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.

It doesn't make sense to disable only the update hook. And although I did not come right out and say it, it is the post-update that I care about. If that still runs, my "issue" still exists.

Show 17 quoted lines
> 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
>
>
-- 
Sitaram
Previous: Pang Yan HanNext: Pang Yan Han
Message 8 of 18 in “Teach receive-pack not to run update hook for corrupt/non existent ref”
  1. 0/2 Teach receive-pack not to run update hook for corrupt/non existent refPang Yan Han, Sep 25, 2011
  2. 1/2 is_url: Remove redundant assignmentPang Yan Han, Sep 25, 2011
  3. Tay Ray ChuanSep 25, 2011
  4. Junio C HamanoSep 26, 2011
  5. Jeff KingSep 26, 2011
  6. 2/2 receive-pack: Don't run update hook for corrupt or nonexistent refPang Yan Han, Sep 25, 2011
  7. 2/2 run post-receive and post-update hooks with empty stdin/no args for invalid ref deletionPang Yan Han, Sep 25, 2011
  8. Sitaram ChamartySep 25, 2011
  9. Pang Yan HanSep 25, 2011
  10. Sitaram ChamartySep 25, 2011
  11. Junio C HamanoSep 26, 2011
  12. Sitaram ChamartySep 26, 2011
  13. Junio C HamanoSep 26, 2011
  14. Junio C HamanoSep 27, 2011
  15. Pang Yan HanSep 27, 2011
  16. Junio C HamanoSep 27, 2011
  17. Pang Yan HanSep 27, 2011
  18. Sitaram ChamartySep 27, 2011

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.