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

Re: Fetch-hooks

From
LGLeo Gaspard <leo@gaspard.io>
Date
Feb 10, 2018, 18:03 UTC
Message-ID
<92130c51-9e5d-39e9-3129-046295ecb353@gaspard.io>
In-Reply-To
<9ab95c53-61e5-06a3-535e-a8916b3e5ec1@gaspard.io>

On 02/10/2018 02:33 AM, Leo Gaspard wrote:> I guess the very early part of the discussion you're speaking of is what

Show 8 quoted lines
> I was assuming after reading
>     https://marc.info/?l=git&m=132478296309094&w=2
> 
> [...]
> 
> So the reason for a post-fetch in my opinion is the same as for a
> pre-push / pre-commit: not changing the user's workflow, while providing
> additional features.

Well, re-reading my email, it looks aggressive to me now... sorry about that!

What I meant was basically, that in my mind pre-push or pre-commit are also local-only things, and they are really useful in that they allow to block the push or the commit if some conditions are not met (eg. block commit with trailing whitespace, or block push of unsigned commits).

In pretty much the same way, what I'm really looking for is a way to “block the fetch” (from a user-visible standpoint) -- like pre-push but in the opposite direction. I hope such a goal is not an anti-pattern for hook design?

In order to do this, I first tried updating this tweak-fetch hook patch from late 2011, and then learned that it would cause too high a load on servers. Then, while brainstorming another solution, this idea of a notification-only post-fetch hook arose. But, as I noticed while writing my previous answer, this suffers the same the-hook-writer-must-correctly-update-FETCH_HEAD-concurrently-with-remote-branch issue that you pointed out just after the “*HOWEVER*” in [1]. So that solution is likely a bad solution too. I guess we'll continue the search for a good solution in the side-thread with Peff, hoping to figure one out.

That being said about what I meant in my last email, obviously you're the one who has the say on what goes in or not! And if it's an anti-feature I'd much rather know it now than after spending a few nights coding :)

So, what do you think about this use case I'm thinking of? (ie. “blocking the fetch” like pre-push “blocks the push” and pre-commit “blocks the commit”?)

[1] https://marc.info/?l=git&m=132478296309094&w=2
Previous: Leo GaspardNext: Jeff King
Message 18 of 38 in “Fetch-hooks”
  1. Leo GaspardFeb 7, 2018
  2. Ævar Arnfjörð BjarmasonFeb 7, 2018
  3. Leo GaspardFeb 8, 2018
  4. Joey HessFeb 8, 2018
  5. Leo GaspardFeb 8, 2018
  6. Ævar Arnfjörð BjarmasonFeb 8, 2018
  7. Leo GaspardFeb 8, 2018
  8. Ævar Arnfjörð BjarmasonFeb 9, 2018
  9. Leo GaspardFeb 9, 2018
  10. Ævar Arnfjörð BjarmasonFeb 9, 2018
  11. Jeff KingFeb 9, 2018
  12. Junio C HamanoFeb 9, 2018
  13. Leo GaspardFeb 9, 2018
  14. Jeff KingFeb 10, 2018
  15. Leo GaspardFeb 10, 2018
  16. Junio C HamanoFeb 10, 2018
  17. Leo GaspardFeb 10, 2018
  18. Leo GaspardFeb 10, 2018
  19. Jeff KingFeb 10, 2018
  20. Leo GaspardFeb 10, 2018
  21. Brandon WilliamsFeb 12, 2018
  22. Leo GaspardFeb 13, 2018
  23. Jeff KingFeb 14, 2018
  24. Jeff KingFeb 14, 2018
  25. Leo GaspardFeb 14, 2018
  26. Jeff KingFeb 19, 2018
  27. Leo GaspardFeb 19, 2018
  28. Jacob KellerFeb 20, 2018
  29. Jeff KingFeb 20, 2018
  30. Leo GaspardFeb 20, 2018
  31. Jacob KellerFeb 14, 2018
  32. Leo GaspardFeb 9, 2018
  33. Joey HessFeb 9, 2018
  34. 0/2 fetch: add tweak-fetch hookLeo Gaspard, Feb 9, 2018
  35. 1/2 fetch: preparations for tweak-fetch hookLeo Gaspard, Feb 9, 2018
  36. 2/2 fetch: add tweak-fetch hookLeo Gaspard, Feb 9, 2018
  37. Junio C HamanoFeb 9, 2018
  38. Junio C HamanoFeb 9, 2018

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.