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

Re: git pull for update of netdev fails.

From
Shawn Pearce <spearce@spearce.org>
Date
Sep 20, 2006, 21:49 UTC
Message-ID
<20060920214903.GF24415@spearce.org>
In-Reply-To
<Pine.LNX.4.63.0609202333320.19042@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 7 quoted lines
> On Wed, 20 Sep 2006, Shawn Pearce wrote:
> > The server side could also check if the current value in the ref
> > (if it exists) is contained within the new value of the ref.  Yes,
> > I know it doesn't today, but the point is it could.  And I was
> > saying maybe it should when there is no update hook present.
> 
> The point being that this check is not necessarily inexpensive.

But its not _that_ expensive. If the option is set to refuse non-fast forwards then you take the hit and do the check; if its set to allow them then you can bypass the check entirely and let the client direct it (like it does today). Speed vs. safety.

I currently use "git rev-list $2..$1" in my update hooks to make sure the update is strictly a fast-foward type update for all branches. Enabling this option and having the check run in receive-pack would be faster than what I'm doing now (one less fork).

> But you 
> are right, we could introduce this as a security measure. But is it really 
> intuitive to skip this test when an update hook is added?
Now that you say it, no.  These two things (update hook and non-fast
forward update) are unrelated.  If the update hook wants to make
the decision on a per branch basis then the option to allow a
non-fast forward push must be enabled in the config file.
 
> I'd rather set another config variable with --shared, which tells git to 
> refuse receiving non-fast-forwards. This could be a sensible setting in 
> other setups than shared ones after all. Thoughts?
Agree completely.
-- 
Shawn.
Previous: Shawn PearceNext: Shawn Pearce
Message 17 of 43 in “git pull for update of netdev fails.”
  1. Stephen HemmingerSep 20, 2006
  2. Linus TorvaldsSep 20, 2006
  3. Petr BaudisSep 20, 2006
  4. Johannes SchindelinSep 20, 2006
  5. Petr BaudisSep 20, 2006
  6. Linus TorvaldsSep 20, 2006
  7. Linus TorvaldsSep 20, 2006
  8. Shawn PearceSep 20, 2006
  9. Linus TorvaldsSep 20, 2006
  10. Shawn PearceSep 20, 2006
  11. Johannes SchindelinSep 20, 2006
  12. Shawn PearceSep 20, 2006
  13. Johannes SchindelinSep 20, 2006
  14. Junio C HamanoSep 20, 2006
  15. Johannes SchindelinSep 20, 2006
  16. Shawn PearceSep 20, 2006
  17. Shawn PearceSep 20, 2006
  18. Shawn PearceSep 20, 2006
  19. Linus TorvaldsSep 20, 2006
  20. Johannes SchindelinSep 20, 2006
  21. Shawn PearceSep 20, 2006
  22. Johannes SchindelinSep 20, 2006
  23. Shawn PearceSep 20, 2006
  24. Jakub NarebskiSep 20, 2006
  25. Petr BaudisSep 23, 2006
  26. Shawn PearceSep 23, 2006
  27. Petr BaudisSep 23, 2006
  28. Catalin MarinasSep 23, 2006
  29. Catalin MarinasSep 23, 2006
  30. Petr BaudisSep 24, 2006
  31. Catalin MarinasSep 25, 2006
  32. Junio C HamanoSep 20, 2006
  33. Petr BaudisSep 20, 2006
  34. Linus TorvaldsSep 20, 2006
  35. Jakub NarebskiSep 20, 2006
  36. Linus TorvaldsSep 20, 2006
  37. Shawn PearceSep 20, 2006
  38. Linus TorvaldsSep 20, 2006
  39. Krzysztof HalasaSep 20, 2006
  40. Petr BaudisSep 23, 2006
  41. Jakub NarebskiSep 20, 2006
  42. Johannes SchindelinSep 21, 2006
  43. Jeff GarzikSep 20, 2006

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.