From: Radoslaw Szkodzinski <astralstorm@o2.pl>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: Question about possible git races
Date: Thu, 23 Mar 2006 02:22:34 +0100 [thread overview]
Message-ID: <200603230222.38978.astralstorm@o2.pl> (raw)
In-Reply-To: <7vacbi6m91.fsf@assigned-by-dhcp.cox.net>
[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]
On Thursday 23 March 2006 01:24, Junio C Hamano wrote yet:
> Radoslaw Szkodzinski <astralstorm@o2.pl> 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.
So there is locking I've missed while reading through the source.
Guess all the coffee doesn't help.
There is a lock, so the other git-receive-pack for given ref will fail.
Does that also work for git-local-fetch with -l option?
Looks good though that I can fetch to another ref.
>
> > 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.
I should have known better than to use vague words.
For me fetch = git-*-fetch. Which in turn calls git-receive-pack.
Thank you for the precise answer.
--
GPG Key id: 0xD1F10BA2
Fingerprint: 96E2 304A B9C4 949A 10A0 9105 9543 0453 D1F1 0BA2
AstralStorm
[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]
next prev parent reply other threads:[~2006-03-23 1:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-20 16:24 Question about possible git races Radoslaw Szkodzinski
2006-03-22 20:46 ` Radoslaw Szkodzinski
2006-03-22 23:55 ` Andreas Ericsson
2006-03-22 23:28 ` Andreas Ericsson
2006-03-23 1:24 ` Radoslaw Szkodzinski
2006-03-23 2:55 ` Andreas Ericsson
2006-03-23 20:51 ` Radoslaw Szkodzinski
2006-03-23 0:24 ` Junio C Hamano
2006-03-23 1:22 ` Radoslaw Szkodzinski [this message]
2006-03-23 1:46 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200603230222.38978.astralstorm@o2.pl \
--to=astralstorm@o2.pl \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.