Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

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

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:46:07

On Sat, Feb 7, 2009 at 5:27 PM, Jan Krüger [off-list ref] wrote:
Hi everyone,

recently on IRC we had a case where someone had accidentally deleted
the "current" branch (i.e. thing pointed to by HEAD) by using "git push
origin :master". This broke the remote HEAD as well as the local
refs/remotes/origin/HEAD. Not good. I think we want to make it harder
to get into this situation.

Personally, without being aware of any potential counterindications, I
think the best solution from a usability point of view would
be to have receive-pack reject deletions of what's currently in HEAD.
The question is, of course: how do we go about situations where someone
actually wants to delete the branch HEAD points at?

1. reject deletion and point out a command to change HEAD first (I
don't think we've got a command to do this remotely; do we want one?)

2. automatically change HEAD to something else if there's any other
branch (eww)

3. accept the deletion but warn the user that she just broke the
repository (especially eww because it also breaks the local tracking
ref)

Any smart ideas?
This was brought up before:
http://marc.info/?l=git&m=123254293910829&w=2

But I don't think it reached any conclusion.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help