Re: Question about possible git races

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

 



Radoslaw Szkodzinski <astralstorm@xxxxx> writes:

> - push vs pull
>
> - push vs push
>
> - fetch vs fetch

About push vs push, with "really bare git", I take it that you
mean two send-pack from remote sites running two receive-pack
simultaneously.

There is an explicit race avoidance between the receive-pack
processes.  When a ref (either branch head or a tag) is updated,
it does:

 - read the current value from the ref.
 - do its work.
 - lock to prevent others to create the temporary file for
   updating the ref.
 - create the temporary file for the ref and write the new value.
 - check if the ref's value has not changed from what it
   initially read;
 - rename the temporary file to the ref to unlock.

Read receive-pack.c::update() for exact details if you are
interested.

> I'm meaning really bare git there, w/o bash+perl scripts.

The question does not make any sense for other cases, because
branch update by fetch and pull are all scripts based.

-
: 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]