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

Re: [PATCH] Allow update hooks to update refs on their own

From
Steven Grimm <koreth@midwinter.com>
Date
Nov 28, 2007, 05:20 UTC
Message-ID
<C24B0B38-BD37-4BDA-B138-275C900670AE@midwinter.com>
In-Reply-To
<7vzlwz9ghg.fsf@gitster.siamese.dyndns.org>
On Nov 27, 2007, at 7:49 PM, Junio C Hamano wrote:
> Yeah, and I am wondering why update hook needs to be changed for this.
> Didn't we introduce post-receive exactly for this sort of thing?

I didn't think the post-receive hook could reject a revision. I need to be able to do that here, e.g., if the user's change fails to commit because it's rejected by an svn commit hook. (Hooks upon hooks upon hooks...) If I do the svn commit in post-receive it's not clear how the user would repush the change after fixing it -- their fix would show up as a delta on top of a revision that I can't commit on its own to svn, so I would somehow have to know to do a squash merge and there would no longer be a one-to-one correspondence between git and svn revisions. That's not a total showstopper (I'm rewriting history anyway) but it sure seems like it'll be confusing and error-prone.

Also, running in post-receive will subject me to race conditions that aren't present in the update hook case; if I make my update hook script do its own locking and update the refs on its own, I'm guaranteed no other push will come along and update my ref out from under me. In post-receive there is no such guarantee and I may end up sending two pushes' worth of commits to svn when I think I'm only sending one.

If I'm misunderstanding the flow of control, please feel free to correct me. It just seemed like update was the only good place to do what I needed to do.

-Steve
Previous: Junio C HamanoNext: Jeff King
Message 8 of 44 in “Allow update hooks to update refs on their own”
  1. Allow update hooks to update refs on their ownSteven Grimm, Nov 27, 2007
  2. Jakub NarebskiNov 27, 2007
  3. Steven GrimmNov 27, 2007
  4. Junio C HamanoNov 28, 2007
  5. Steven GrimmNov 28, 2007
  6. Daniel BarkalowNov 28, 2007
  7. Junio C HamanoNov 28, 2007
  8. Steven GrimmNov 28, 2007
  9. Jeff KingNov 28, 2007
  10. Junio C HamanoNov 28, 2007
  11. Allow update hooks to update refs on their ownSteven Grimm, Nov 28, 2007
  12. Jeff KingNov 28, 2007
  13. Steven GrimmNov 28, 2007
  14. Jeff KingNov 28, 2007
  15. Junio C HamanoNov 28, 2007
  16. Allow update hooks to update refs on their ownSteven Grimm, Nov 28, 2007
  17. Jeff KingNov 28, 2007
  18. Junio C HamanoNov 28, 2007
  19. Steven GrimmNov 29, 2007
  20. Junio C HamanoNov 30, 2007
  21. Allow update hooks to update refs on their own.Steven Grimm, Dec 2, 2007
  22. Junio C HamanoDec 2, 2007
  23. Jeff KingDec 3, 2007
  24. Junio C HamanoDec 3, 2007
  25. Junio C HamanoDec 3, 2007
  26. Steven GrimmDec 5, 2007
  27. Junio C HamanoDec 5, 2007
  28. Junio C HamanoDec 5, 2007
  29. Jeff KingDec 6, 2007
  30. Junio C HamanoDec 6, 2007
  31. Jeff KingDec 6, 2007
  32. Steven GrimmDec 6, 2007
  33. Shawn O. PearceDec 3, 2007
  34. Junio C HamanoDec 3, 2007
  35. Shawn O. PearceDec 4, 2007
  36. Johannes SchindelinDec 3, 2007
  37. Shawn O. PearceDec 4, 2007
  38. Johannes SchindelinDec 4, 2007
  39. Shawn O. PearceDec 4, 2007
  40. Johannes SchindelinDec 4, 2007
  41. Steven GrimmDec 4, 2007
  42. Shawn O. PearceDec 4, 2007
  43. Junio C HamanoNov 28, 2007
  44. Jeff KingNov 28, 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.