Re: Interleaved remote branch update problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Jeff King <peff@xxxxxxxx> wrote:
>On Thu, Apr 05, 2012 at 03:49:14PM -0600, Martin Fick wrote:
>
>> I have noticed that git push --force does not reliably force 
>> a push to remote branches.  In particular, it will not 
>> update a remote branch if that branch has been updated since 
>> the beginning of the push.  Is this normal, is this 
>> expected?
>
>Yes, that's expected. --force means "it's OK to push something that
> will rewind history", not "it's OK to clobber somebody else who is
> pushing at the same time".

But why is it ok to clobber somebody else right after they pushed, this seems like splitting hairs?  Why force me to wait to clobber?  Afterall, git goes through great pains to only lock a ref for the small duration of time when it is updated.  But this behavior means that it effectively is actually locked for the entire duration of a push except that it teases a client into thinking it is not locked until then end of a potential costly transfer.

And what about the fast forward case?  If client A is pushing change a and then client B starts pushing b which depends on a, why shouldn't B succeed as long as A succeeds first, even without the force flag?  But it does not work this way even with the force flag.


> The determination for the former happens on the client
>side, and for the latter on the server side.
>
>If you want the latter, you would need a protocol extension, I think;
>I'm pretty sure the client doesn't transmit the force flag at all to
>the
>server (and I don't think this should be tied to the force flag
>automatically; they are two different cases, and you may be in a
>situation where it is safe to do the former but not necessarily the
>latter).

I think this use case distinction is irrelevant to users on a shared server unless you could somehow tell git to "only clobber the branch if it currently points to shax".  Which is sort of what git is pretending to do, but it isn't really since the user isn't specifying shax, it is determined when the push starts and is inherently subject to a race.  It's not like the user can safely determine what the remote branch points to before they update it to see if it is ok to clobber it.

Just a user's perspective...

-Martin

Employee of Qualcomm Innovation Center,Inc. which is a member of Code Aurora Forum
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]