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

Re: [PATCH] Switch receive.denyCurrentBranch to "refuse"

From
Sam Vilain <sam@vilain.net>
Date
Feb 2, 2009, 10:50 UTC
Message-ID
<1233571805.20131.358.camel@maia.lan>
In-Reply-To
<7v1vuhkzmp.fsf@gitster.siamese.dyndns.org>
On Mon, 2009-02-02 at 00:32 -0800, Junio C Hamano wrote:
Show 20 quoted lines
> > The other affects
> > a small number of users who are doing something which is labeled in many
> > places as a bad thing to want to do.
> 
> Sorry, but I do not agree with this.
> 
> What is bad is to push into a repository that is used for editing.  That
> is labelled as a bad thing to want to do.
> 
> It is often the easiest to push and then run "reset --hard" (perhaps from
> the post-update script) to propagate your change to a repository that is
> not usually used for editing.  E.g. that has always been the way I update
> my private repository at k.org that I use for final testing before pushing
> out the results that I built and tested on my personal machine.  People
> who have live web pages served from a checkout do that, too.  It is not a
> bad thing to do at all, and you can find many instructions with google
> without spending a lot of time to do exactly that.
> 
>     http://kerneltrap.org/mailarchive/git/2008/7/1/2315924
>     http://utsl.gen.nz/git/post-update
Heh, thanks for referring me to my own script ;-)

I think a "repository that is used for editing" can be practically defined as one which does not have any dirty local files. Or, if there are dirty local files then they are none of the files which would be changed by the push, or none of them would be changed by the push. Similar to the check that 'git merge' does.

With that definition, if receive.denyCurrentBranch is set to "update" it could be pretty much automagic, perhaps even good enough behaviour to consider making it the default. This kind of behaviour is what my post-update hook tries to achieve, but it really needs a corresponding piece in the update hook, and I didn't code all of the conditions above into it.

Sam.
Previous: Junio C HamanoNext: Johannes Schindelin
Message 37 of 43 in “Switch receive.denyCurrentBranch to "refuse"”
  1. Switch receive.denyCurrentBranch to "refuse"Johannes Schindelin, Jan 30, 2009
  2. Jay SoffianJan 30, 2009
  3. Asheesh LaroiaJan 30, 2009
  4. Dave AbrahamsApr 13, 2010
  5. Junio C HamanoApr 13, 2010
  6. Miklos VajnaJan 30, 2009
  7. Johannes SchindelinJan 30, 2009
  8. Miklos VajnaFeb 11, 2009
  9. Junio C HamanoFeb 11, 2009
  10. Jeff KingJan 30, 2009
  11. Johannes SchindelinJan 30, 2009
  12. Johannes SixtJan 30, 2009
  13. Jeff KingJan 30, 2009
  14. Johannes SchindelinJan 30, 2009
  15. Jeff KingJan 30, 2009
  16. Jay SoffianJan 30, 2009
  17. Jeff KingJan 30, 2009
  18. Johannes SchindelinJan 30, 2009
  19. Jay SoffianJan 30, 2009
  20. Johannes SchindelinJan 30, 2009
  21. Nanako ShiraishiJan 31, 2009
  22. Junio C HamanoFeb 1, 2009
  23. Junio C HamanoFeb 1, 2009
  24. Jeff KingFeb 2, 2009
  25. Junio C HamanoFeb 3, 2009
  26. Junio C HamanoFeb 3, 2009
  27. Jeff KingFeb 6, 2009
  28. Junio C HamanoFeb 7, 2009
  29. Junio C HamanoFeb 3, 2009
  30. Jeff KingFeb 3, 2009
  31. Junio C HamanoFeb 3, 2009
  32. Junio C HamanoFeb 1, 2009
  33. Sam VilainFeb 1, 2009
  34. Junio C HamanoFeb 1, 2009
  35. Sam VilainFeb 2, 2009
  36. Junio C HamanoFeb 2, 2009
  37. Sam VilainFeb 2, 2009
  38. Johannes SchindelinFeb 1, 2009
  39. Junio C HamanoFeb 1, 2009
  40. Junio C HamanoJan 30, 2009
  41. Johannes SchindelinJan 30, 2009
  42. Jeff KingJan 30, 2009
  43. Johannes SchindelinJan 30, 2009

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.