From: Jan Hudec <bulb@ucw.cz>
To: Robert Boone <robert@rlb3.com>
Cc: git@vger.kernel.org
Subject: Re: Centralized processes in git
Date: Mon, 20 Aug 2007 21:29:47 +0200 [thread overview]
Message-ID: <20070820192947.GD8542@efreet.light.src> (raw)
In-Reply-To: <31FEEAE6-58A6-4A74-9DB7-E6F9D56D1C48@rlb3.com>
[-- Attachment #1: Type: text/plain, Size: 2327 bytes --]
On Mon, Aug 20, 2007 at 13:30:47 -0500, Robert Boone wrote:
> Hello,
> My company is looking at git to replace subversion as our scm. We have
> a small team of developers which need to publish to a centralized
> repository. One thing we would like is to have an automated bug fix merge
> ability. So if I make a bug fix to master we want that fix to be merged
> into other branches that we set. If there is a conflict we want that person
> to be notified by email or some other way. I would like to know if anyone
> on the list has a good way to implement this?
Normal way of pushing changes to the central repo is over the ssh protocol,
which invokes git (specifically git-receive-pack) on the server and that in
turn invokes pre-receive, update, post-receive and post-update hooks. The
first two can prevent the refs to be updated, the later two are for arbitrary
post-processing.
To do the automatic merging like you describe, you'd probably put up
a script to run from post-receive and start whatever merges you want to do.
That script gets a list of updated refs along with new and old version names
on standard input, so you just look for your mainline name (refs/heads/master
probably) and if you find, run the appropriate merges. You can of course
program whatever notifications you want in that script.
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.
I'd recommend the hook script to write the things to just write the
instructions what to merge somewhere (into a named pipe, probably -- or
socket, which could be extended to separate server) and process that with
a continually running "daemon" script, to avoid synchronization issues.
In git distribution is a pair of scripts in contrib/continuous directory,
that use the notifying hook + daemon approach to run tests against each
commit, so you can use that for inspiration. It's in perl and being universal
complicates it quite a bit though; you can get a lot shorter with shell and
everything hardcoded.
--
Jan 'Bulb' Hudec <bulb@ucw.cz>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-08-20 19:30 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 [this message]
2007-08-21 0:36 ` Steven Grimm
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=20070820192947.GD8542@efreet.light.src \
--to=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).