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

Re: [PATCH] Added hook in git-receive-pack

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 1, 2005, 00:25 UTC
Message-ID
<Pine.LNX.4.58.0507311720220.14342@g5.osdl.org>
In-Reply-To
<7vhdeabjo7.fsf@assigned-by-dhcp.cox.net>
On Sun, 31 Jul 2005, Junio C Hamano wrote:
> 
> You are absolutely right.  It should grab some sort of lock
> while it does its thing (would fcntl(F_GETLK) be acceptable to
> networked filesystem folks?).

There is no lock that works reliably except for the "create a directory and rename it onto another directory"

Please do it in the hook layer.
> I have one question regarding the hooks.  We seem to prefer
> avoiding system and roll our own.  Is there a particular reason,
> other than bypassing the need to quote parameters for shell?

Hmm.. I suspect it's partly just because there is existing code that does the fork()/exec() thing because it needs to do IO, and system() doesn't close the right pipes after fork etc.

"system()" really is very inflexible. It basically never works if you have any shared file descriptors.

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 15 in “Added hook in git-receive-pack”
  1. Added hook in git-receive-packJosef Weidendorfer, Jul 31, 2005
  2. Linus TorvaldsJul 31, 2005
  3. Junio C HamanoJul 31, 2005
  4. Linus TorvaldsJul 31, 2005
  5. Junio C HamanoJul 31, 2005
  6. Johannes SchindelinJul 31, 2005
  7. Linus TorvaldsJul 31, 2005
  8. Junio C HamanoAug 1, 2005
  9. Linus TorvaldsAug 1, 2005
  10. Junio C HamanoJul 31, 2005
  11. Josef WeidendorferJul 31, 2005
  12. Junio C HamanoAug 1, 2005
  13. Josef WeidendorferAug 13, 2005
  14. Junio C HamanoAug 13, 2005
  15. Josef WeidendorferAug 13, 2005

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.