{"thread":{"id":"26303","subject":"[RFC] Per-branch receive.* settings","startedAt":"2011-01-18T23:07:37Z","lastAt":"2011-01-19T00:12:27Z","messageCount":2,"participants":["Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159610","messageId":"AANLkTimt8BPKsiyVEO+7i+so8337LaUu4A4jpywvJ-Ar@mail.gmail.com","threadId":"26303","inReplyTo":null,"subject":"[RFC] Per-branch receive.* settings","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-01-18T23:07:37Z","receivedAt":"2011-01-18T23:07:37Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Currently you can do in your server's git config:\n\n    [receive]\n        denyDeletes = true\n        denyNonFastForwards = true\n\nBut for most servers that's not what you want, you actually want to\ndeny those things to the master branch, but allow people to have their\nprivate topic branches that they can reset. So how about allowing:\n\n    [receive]\n        denyDeletes = false\n        denyNonFastForwards = false\n\n    [branch \"master\"]\n        denyDeletes = true\n        denyNonFastForwards = true\n\nI.e. have a per-branch setting that overrides the global setting?\n\n(Of course ideally this would be:\n    \"branch.master.receive.{denyDeletes,denyNonFastForwards}\"\n\nBut the *.ini format can only have a depth of three, so it has to be:\n\n    \"branch.master.{denyDeletes,denyNonFastForwards}\"\n\nOr perhaps:\n\n    \"branch.master.receive-{denyDeletes,denyNonFastForwards}\"\n\nAnyway, I can code this up if there's interest in it. This could also\nbe done with a .git/hooks/update hook, but IMO it's better to have\nthis as a documented setting for the most common things you want to\ndeny/allow.\n"},{"id":"159613","messageId":"7vbp3dkaz8.fsf@alter.siamese.dyndns.org","threadId":"26303","inReplyTo":"AANLkTimt8BPKsiyVEO+7i+so8337LaUu4A4jpywvJ-Ar@mail.gmail.com","subject":"Re: [RFC] Per-branch receive.* settings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-19T00:12:27Z","receivedAt":"2011-01-19T00:12:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> Currently you can do in your server's git config:\n>\n>     [receive]\n>         denyDeletes = true\n>         denyNonFastForwards = true\n>\n> But for most servers that's not what you want, you actually want to\n> deny those things to the master branch, but allow people to have their\n> private topic branches that they can reset. So how about allowing:\n>\n>     [receive]\n>         denyDeletes = false\n>         denyNonFastForwards = false\n>\n>     [branch \"master\"]\n>         denyDeletes = true\n>         denyNonFastForwards = true\n\nWhile this would not be better than having no such feature, if you are\ntalking about allow(ing) \"people\", I doubt this would scale very well.\n\nI wonder some globbing with site-specific naming convention would be more\nscalable:\n\n\t[receive]\n        \tdenyDeletes = refs/heads/* && !refs/heads/*/*\n                denyNonFastForwards = refs/heads/* && !refs/heads/*/*\n\nAnd in the meantime, of course you can use your update hook, mimicking\nvarious examples, ranging from contrib/hooks/update-paranoid,\nDocumentation/howto/update-hook-example.txt, and hooks/update.sample.\n"}]}