Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Pushing to a non-bare repository

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:52

(sorry, resending to avoid vger spam filter)

Linus Torvalds [off-list ref] writes:
On Sat, 3 Feb 2007, Simon 'corecode' Schubert wrote:
quoted
However, your suggestion does not help people who don't know better.  Pushing
into the HEAD branch of another repo breaks stuff there.  Badly.  This should
be prevented, really.
No, please don't break it. I do it all the time.

I just do "git push remote".

And then eventually on the remote end I do end up having to "update", but 
that's a simple "git checkout -f".
I do not think anybody is disputing the fact that the current
git-push does work as expected.

But expectation is a relative thing.  The current behaviour is
likely to confuse new people; it is like a sharp-edged razor
that can cut through fingers if the user does not know which end
is the handle and which end is the blade.

I sent a "if Simon wanted to do it, it is simple" concept patch,
but obviously Simon or anybody can do the same check in the
update hook if needed.  However, that would make the newbie
safety opt_in, and there inevitably will come a discussion on
what should be the default.

And I suspect that the recent trend is that people would want
the default to be more newbie friendly, while leaving an opt_in
escape hatch for power-user convenience.  Obviously my patch
does not have that escape hatch, and as such it is not meant for
inclusion as-is.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help