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

Re: [RFC] Per-branch receive.* settings

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 19, 2011, 00:12 UTC
Message-ID
<7vbp3dkaz8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTimt8BPKsiyVEO+7i+so8337LaUu4A4jpywvJ-Ar@mail.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 17 quoted lines
> 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

While this would not be better than having no such feature, if you are talking about allow(ing) "people", I doubt this would scale very well.

I wonder some globbing with site-specific naming convention would be more scalable:

	[receive]
        	denyDeletes = refs/heads/* && !refs/heads/*/*
                denyNonFastForwards = refs/heads/* && !refs/heads/*/*

And in the meantime, of course you can use your update hook, mimicking various examples, ranging from contrib/hooks/update-paranoid, Documentation/howto/update-hook-example.txt, and hooks/update.sample.

Previous: Ævar Arnfjörð Bjarmason
Message 2 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.