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

Re: Force-with-lease and new branches

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:15

John Keeping [off-list ref] writes:
It looks like this has been the case since the first version of what
would become --force-with-lease [1] and I can't find any discussion
around this particular behaviour in the three versions of that patch set
I found on Gmane [2], [3], [4].
I never considered the "creation of a new ref, ensuring that it must
not exist yet" use case when designing it.  I do not think anybody
in the discussion did so, either.
So my questions are: what will break if we decide to treat "no remote
tracking branch" as "new branch" and is that a reasonable thing to do?
If you are only following a subset of branches they have, you may
never get copies of them in your refs/remotes/$there/ hierarchy, so
your addition would make 'force-with-lease to create' mistakenly
think that a branch does not exist over there, when there is already
one, and it will attempt to push your version through.  As long as
that is caught and fail on the receiving end of the request, it is
OK, I would think.  I didn't think it through nor checked the code
to make sure the remote end behaves sensibly--please do so yourself
if you want to pursue this route ;-).

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