From: Steven Grimm <koreth@midwinter.com>
To: Jan Hudec <bulb@ucw.cz>
Cc: Robert Boone <robert@rlb3.com>, git@vger.kernel.org
Subject: Re: Centralized processes in git
Date: Tue, 21 Aug 2007 08:36:40 +0800 [thread overview]
Message-ID: <46CA3398.9060803@midwinter.com> (raw)
In-Reply-To: <20070820192947.GD8542@efreet.light.src>
Jan Hudec wrote:
> Commit would undo any changes pushed between checking out a branch and
> commiting, so you should probably do the merges on a separate repository,
> that will only be managed by the scripts. You can use the alternates
> mechanism to avoid duplicating the data if that repository will be on the
> central server.
>
That makes this kind of operation ten times more complicated than it
ought to be, IMO.
I wonder if it makes sense to expose a repository locking mechanism for
this kind of application. The builtin git commands would test for the
lock and block (waiting up to some configurable timeout) until it went
away, but wouldn't necessarily ever actually lock things themselves. Or
maybe a shared/exclusive lock (aka an rwlock) would be appropriate here;
the repository-altering commands would grab a shared lock.
A lock-and-block primitive eliminates the need for a separate work queue
manager for stuff like this: you just make sure you exclusive-lock the
repo before you start your postprocessing (and make sure your
postprocessing handles the case where another commit landed before you
got launched, of course). Then you know that nothing else will screw
with the repo while you're working, and that your execution will be
serialized. If you don't need serialized operation like that, you just
never grab the exclusive lock and things continue to work as today.
Stupid idea? The wrinkle, of course, is that you need to run git
commands from within your script, so *those* can't block. I can think of
a few easy ways around that, though, e.g., use an environment variable
to identify yourself as the holder of the lock, perhaps by putting your
PID in the lockfile and setting the variable to your PID.
-Steve
next prev parent reply other threads:[~2007-08-21 0:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-20 18:30 Centralized processes in git Robert Boone
2007-08-20 19:29 ` Jan Hudec
2007-08-21 0:36 ` Steven Grimm [this message]
2007-08-21 0:40 ` Steven Grimm
2007-08-21 6:13 ` 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=46CA3398.9060803@midwinter.com \
--to=koreth@midwinter.com \
--cc=bulb@ucw.cz \
--cc=git@vger.kernel.org \
--cc=robert@rlb3.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).