Add a few more values for receive.denyCurrentBranch
commit46fe2bf0d58c0817ce91fa65190c03d67bb04a15
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 16 Feb 2009 20:52:51 +0000 (16 21:52 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 7 Feb 2010 21:58:37 +0000 (7 22:58 +0100)
treecf658c046c71188c65bf815233f566470bc00564
parent586f59d95e691b2410968d0440b7bb6f5460e849
Add a few more values for receive.denyCurrentBranch

Some people insist on work flows where they push into their checked-out
branches.

Now, everybody should agree that these people better know what they
are doing, and that most users are Better Of Avoiding That.

However, it seems that the existing users of the feature-not-a-bug that
you can push into non-bare repositories are preparing to give the Git
developers as much grief as for the dashed -> undashed migration, and
therefore it may be wise to give them a gift in return.

The gift consists of two new options you can give the config variable
receive.denyCurrentBranch:

'updateInstead':
Try to merge the working tree with the new tip of the branch
(which can lead to really horrible merge conflicts).

'detachInstead':
Detach the HEAD, thereby avoiding a disagreement between the
HEAD and the index (as well as the working tree), possibly
leaving the local user wondering how on earth her HEAD became
so detached.

And now everybody:

Gimme rope, Johannes,
Gimme rope, Johannes,
Gimme rope, Johannes,
'fore the moaning come,
Gimme rope, Johannes,
Rope, Johannes,
Rope before the moaning come.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Documentation/config.txt
builtin-receive-pack.c
t/t5516-fetch-push.sh