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

[RFC] Per-branch receive.* settings

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jan 18, 2011, 23:07 UTC
Message-ID
<AANLkTimt8BPKsiyVEO+7i+so8337LaUu4A4jpywvJ-Ar@mail.gmail.com>
Currently you can do in your server's git config:
    [receive]
        denyDeletes = true
        denyNonFastForwards = true

But for most servers that's not what you want, you actually want to deny those things to the master branch, but allow people to have their private topic branches that they can reset. So how about allowing:

    [receive]
        denyDeletes = false
        denyNonFastForwards = false
    [branch "master"]
        denyDeletes = true
        denyNonFastForwards = true
I.e. have a per-branch setting that overrides the global setting?
(Of course ideally this would be:
    "branch.master.receive.{denyDeletes,denyNonFastForwards}"
But the *.ini format can only have a depth of three, so it has to be:
    "branch.master.{denyDeletes,denyNonFastForwards}"
Or perhaps:
    "branch.master.receive-{denyDeletes,denyNonFastForwards}"

Anyway, I can code this up if there's interest in it. This could also be done with a .git/hooks/update hook, but IMO it's better to have this as a documented setting for the most common things you want to deny/allow.

Next: Junio C Hamano
Message 1 of 2 in “[RFC] Per-branch receive.* settings”
  1. Ævar Arnfjörð BjarmasonJan 18, 2011
  2. Junio C HamanoJan 19, 2011

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.