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

Reason for objects still being written with a failing pre-receive hook?

From
Johan Sørensen <johan@johansorensen.com>
Date
Jun 24, 2009, 13:21 UTC
Message-ID
<9e0f31700906240621k314b4bbehc283c8a1c673a2f1@mail.gmail.com>
Hi,

I'm wondering what the reason is that objects are still being stored, despite a non-zero exit code from the pre-receive hook?

Obviously refs aren't being updated, but I can see this a gateway for abuse if I want to control push permissions per ref via the pre-receive hook (which is the earliest place I know about the ref being pushed to, unless I've missed something). Basically an abuser could continuously attempt to push a set of commits with large blobs to a repo the pre-receive hook doesn't give him access to, and eventually fill up the repo with useless objects. I could nuke these with git-prune (after the fact though), but still it seems illogical that one is allowed to even write the objects in the first place if the hook fails.

If it's expected and accepted behaviour, what other options do I have to prevent a scenario like the above?

Cheers, Johan

Next: Shawn O. Pearce
Message 1 of 3 in “Reason for objects still being written with a failing pre-receive hook?”
  1. Johan SørensenJun 24, 2009
  2. Shawn O. PearceJun 24, 2009
  3. Johan SørensenJun 24, 2009

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.