From: "Shawn O. Pearce" <spearce@spearce.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Steven Grimm <koreth@midwinter.com>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v4] Allow update hooks to update refs on their own.
Date: Mon, 3 Dec 2007 21:20:20 -0500 [thread overview]
Message-ID: <20071204022020.GA14735@spearce.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0712040211270.27959@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> On Mon, 3 Dec 2007, Shawn O. Pearce wrote:
> > You failed to quote the part of my email where I talked about how
> > we set an evironment variable to pass a hint to lockfile.c running
> > within the git-update-ref subprocess to instruct it to perform a
> > different style of locking, one that would work as a "recursive"
> > lock.
> >
> > Such a recursive lock could be useful for a whole lot more than just
> > the update hook. But it would at least allow the update hook to
> > use git-update-ref to safely change the ref, without receive-pack
> > losing its own lock on the ref.
>
> Indeed, I even failed to read it fully ;-)
>
> What do you propose, though? <filename>.lock.<n>?
Sure. :-)
I was also hand-waving. Hoping someone else would fill in the
magic details.
Actually <n> wouldn't be so bad. We could do something like:
GIT_INHERITED_LOCKS="<ref> <depth> <ref> <depth> ..."
where <ref> is a ref name (which cannot contain spaces, even though
some people seem to forget that rule) and <depth> is the number
of times it has been locked already. <depth> of 0 is the current
".lock" file. So the first lock taken out by receive-pack would
be setting:
GIT_INHERITED_LOCKS="refs/heads/master 0"
and another lock on the same ref by a subprocess would then update
it to:
GIT_INHERITED_LOCKS="refs/heads/master 1"
etc...
</hand-waving>
--
Shawn.
next prev parent reply other threads:[~2007-12-04 2:20 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-27 21:17 [PATCH] Allow update hooks to update refs on their own Steven Grimm
2007-11-27 21:21 ` Jakub Narebski
2007-11-27 21:23 ` Steven Grimm
2007-11-28 1:19 ` Junio C Hamano
2007-11-28 2:40 ` Steven Grimm
2007-11-28 3:25 ` Daniel Barkalow
2007-11-28 3:49 ` Junio C Hamano
2007-11-28 5:20 ` Steven Grimm
2007-11-28 16:10 ` Jeff King
2007-11-28 19:00 ` Junio C Hamano
2007-11-28 19:41 ` Steven Grimm
2007-11-28 19:49 ` Jeff King
2007-11-28 20:16 ` Steven Grimm
2007-11-28 20:22 ` Jeff King
2007-11-28 22:01 ` Junio C Hamano
2007-11-28 22:14 ` [PATCH v3] " Steven Grimm
2007-11-28 23:03 ` Jeff King
2007-11-28 23:42 ` Junio C Hamano
2007-11-29 6:44 ` Steven Grimm
2007-11-30 1:06 ` Junio C Hamano
2007-12-02 21:22 ` [PATCH v4] " Steven Grimm
2007-12-02 21:56 ` Junio C Hamano
2007-12-03 2:13 ` Jeff King
2007-12-03 2:16 ` Junio C Hamano
2007-12-03 3:45 ` Junio C Hamano
2007-12-05 22:14 ` Steven Grimm
2007-12-05 22:19 ` Junio C Hamano
2007-12-05 22:29 ` Junio C Hamano
2007-12-06 5:57 ` Jeff King
2007-12-06 6:30 ` Junio C Hamano
2007-12-06 6:36 ` Jeff King
2007-12-06 7:50 ` Steven Grimm
2007-12-03 4:01 ` Shawn O. Pearce
2007-12-03 5:25 ` Junio C Hamano
2007-12-04 1:55 ` Shawn O. Pearce
2007-12-03 11:47 ` Johannes Schindelin
2007-12-04 1:51 ` Shawn O. Pearce
2007-12-04 2:12 ` Johannes Schindelin
2007-12-04 2:20 ` Shawn O. Pearce [this message]
2007-12-04 2:25 ` Johannes Schindelin
2007-12-04 2:33 ` Steven Grimm
2007-12-04 2:34 ` Shawn O. Pearce
2007-11-28 21:49 ` [PATCH] " Junio C Hamano
2007-11-28 22:37 ` Jeff King
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=20071204022020.GA14735@spearce.org \
--to=spearce@spearce.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=koreth@midwinter.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).