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

Re: Git push failure with update hook success

From
Bill Lear <rael@zopyra.com>
Date
Mar 7, 2007, 16:46 UTC
Message-ID
<17902.60536.5890.608883@lisa.zopyra.com>
In-Reply-To
<17902.59497.831409.218529@lisa.zopyra.com>
On Wednesday, March 7, 2007 at 10:29:29 (-0600) Bill Lear writes:
>...
>whether it might be better to call the update hook after everything
>had actually been written, including the log file.

I dug into the code: in receive-pack.c, the command 'update(struct command *cmd)', calls write_ref_sha1() after run_update_hook() and does not check the return code of write_ref_sha1(). write_ref_sha1() will return an error if log_ref_write() fails, as it seems to in our case, here:

		if (logfd < 0)
                        return error("Unable to append to %s: %s",
                                     log_file, strerror(errno));
On the client push side, we get:
error: Unable to append to logs/refs/heads/master: Permission denied
Bill
Previous: Bill LearNext: Shawn O. Pearce
Message 2 of 12 in “Git push failure with update hook success”
  1. Bill LearMar 7, 2007
  2. Bill LearMar 7, 2007
  3. Shawn O. PearceMar 7, 2007
  4. Bill LearMar 7, 2007
  5. Shawn O. PearceMar 7, 2007
  6. Shawn O. PearceMar 7, 2007
  7. Bill LearMar 7, 2007
  8. Andy ParkinsMar 8, 2007
  9. Shawn O. PearceMar 8, 2007
  10. Junio C HamanoMar 8, 2007
  11. Andy ParkinsMar 8, 2007
  12. Shawn O. PearceMar 8, 2007

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.