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

Re: Deleting the "current" branch in remote bare repositories

From
Jeff King <peff@peff.net>
Date
Feb 9, 2009, 18:28 UTC
Message-ID
<20090209182843.GA27109@coredump.intra.peff.net>
In-Reply-To
<7v8wogzr3v.fsf@gitster.siamese.dyndns.org>
On Sun, Feb 08, 2009 at 11:05:40AM -0800, Junio C Hamano wrote:
Show 6 quoted lines
> If you remove the current branch from a repository, the impact that
> operation causes the remote users of the repository would be the same
> whether the repository has or does not have a work tree.  And in that
> sense, I think it should apply equally.  The criteria is not "is it bare",
> but "is it used by people remotely".  IOW, you refuse deletion of the
> current branch if other people may fetch from it.

Here are two reasons why we might not want to conflate the two safety valves:

 1. I'm concerned about it becoming more confusing for end users. Right
    now we don't even bother to look at denyCurrentBranch if we are in a
    bare repo. That is, it is easily explained as "this prevents a
    dangerous operation pushing into a non-bare repo, and if you have a
    bare repo, you don't have to care about or set this at all." But
    having it cover HEAD deletion, too, means that it is now "prevent
    some dangerous operations; some things are dangerous if your repo is
    non-bare, but safe otherwise.  But some of the operations are
    dangerous all the time".
    But maybe that is not really a concern. Most users should leave it
    set to the default unless they are clueful enough to know which
    operations are safe and which are not.
 2. It may not be fine-grained enough. If I am a clueful user with a
    post-receive hook, then I may want to set receive.denyCurrentBranch
    to "ignore". But that doesn't necessarily mean my hook gracefully
    handles _deletion_ of the branch. I may want to keep that set to
    "refuse", since it makes no sense for my workflow.
    Such a user is better served by a separate receive.denyDeleteHEAD
    option.
-Peff
Previous: Jeff KingNext: Jeff King
Message 28 of 29 in “Deleting the "current" branch in remote bare repositories”
  1. Jan KrügerFeb 7, 2009
  2. Felipe ContrerasFeb 7, 2009
  3. Jan KrügerFeb 8, 2009
  4. Jeff KingFeb 8, 2009
  5. Junio C HamanoFeb 8, 2009
  6. Jeff KingFeb 8, 2009
  7. Junio C HamanoFeb 8, 2009
  8. 0/6 Deleting the "current" branch in a remote repositoryJunio C Hamano, Feb 9, 2009
  9. 1/6 builtin-receive-pack.c: do not initialize statics to 0Junio C Hamano, Feb 9, 2009
  10. 2/6 t5400: allow individual tests to failJunio C Hamano, Feb 9, 2009
  11. 3/6 receive-pack: receive.denyDeleteCurrentJunio C Hamano, Feb 9, 2009
  12. 4/6 remote prune: warn dangling symrefsJunio C Hamano, Feb 9, 2009
  13. 5/6 Warn use of "origin" when remotes/origin/HEAD is danglingJunio C Hamano, Feb 9, 2009
  14. 6/6 receive-pack: default receive.denyDeleteCurrent to refuseJunio C Hamano, Feb 9, 2009
  15. Jeff KingFeb 9, 2009
  16. Junio C HamanoFeb 11, 2009
  17. Jeff KingFeb 11, 2009
  18. Jeff KingFeb 11, 2009
  19. Jeff KingFeb 9, 2009
  20. Jeff KingFeb 9, 2009
  21. Junio C HamanoFeb 9, 2009
  22. Jeff KingFeb 10, 2009
  23. Junio C HamanoFeb 10, 2009
  24. Jeff KingFeb 9, 2009
  25. Junio C HamanoFeb 9, 2009
  26. Junio C HamanoFeb 9, 2009
  27. Jeff KingFeb 10, 2009
  28. Jeff KingFeb 9, 2009
  29. Jeff KingFeb 9, 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.