git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: git@vger.kernel.org, Petr Baudis <pasky@suse.cz>,
	Linus Torvalds <torvalds@osdl.org>
Subject: Re: [PATCH] Re: keeping remote repo checked out?
Date: Mon, 28 Nov 2005 23:52:16 -0800	[thread overview]
Message-ID: <7v8xv7lwlr.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0511290141220.25300@iabervon.org> (Daniel Barkalow's message of "Tue, 29 Nov 2005 01:57:09 -0500 (EST)")

Daniel Barkalow <barkalow@iabervon.org> writes:

>>     server$ git checkout production
>>     work$ git checkout master
>>     work$ git pull server production ;# merge into work's master
>>     work$ git push server master:receive_from_work
>>     server$ git pull . receive_from_work ;# merge into server's production
>> 
>> and you make sure receive_from_work is not checked out on server
>> (or production is never pushed into) and always do fast forward
>> and nothing else.
>
> That's what I'm doing currently, actually (with work pushing to 
> "production", but server having checked out "deploy"), and I find it 
> annoying to have to do the pull each time and have a separate head. It 
> also means that, if the stuff on the server is set up as a hook, it'll 
> have to do the locking against concurrent changes to the working tree in 
> pull, which is much more complicated than checkout.

This depends on what is on the checked-out working tree and how
it is used, but one use pattern I was imagining was actually
much more elaborate.  I would set up two non-naked repositories
on the server; let's call them treeR and treeP (reception and
publish).

Each work machine push into its own reception branch of treeR
repository (so you have N reception branches for N workers).  On
the server machine, a daemon monitors the reception branch heads
(inotify or idle poll loop looking at mtime; the details do not
matter), and run the git pull into "master" of treeR.  My daemon
might want to forbid anything but fast forward for this pull, or
might allow any clean merge.  It compiles and runs testsuites
next.  If anything fails during the above process, the owner of
the reception branch is notified about the failure; I might even
want to forcibly rewind her reception branch in this case to
"master" when this happens.

When everything goes well, the daemon goes to treeP and pulls
from treeR's master into "deploy", which is checked out.  This
procedure is the only thing that touches treeP, so this pull is
guaranteed to be a fast forward.

The serialization happens by having a single such daemon
running; no need to worry about locking anymore.

  reply	other threads:[~2005-11-29  7:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-28  7:13 keeping remote repo checked out? James Cloos
2005-11-28  7:48 ` Junio C Hamano
2005-11-28 10:57   ` Petr Baudis
2005-11-28 19:35     ` Junio C Hamano
2005-11-28 21:28       ` Petr Baudis
2005-11-28 21:46         ` Junio C Hamano
2005-11-28 22:26         ` Linus Torvalds
2005-11-29  0:19           ` Daniel Barkalow
2005-11-29  0:43             ` Linus Torvalds
2005-11-29  2:35               ` Daniel Barkalow
2005-11-29  2:39                 ` Linus Torvalds
2005-11-29  3:40                   ` [PATCH] " Daniel Barkalow
2005-11-29  4:34                     ` Linus Torvalds
2005-11-29  6:02                       ` Daniel Barkalow
2005-11-29  6:38                         ` Junio C Hamano
2005-11-29  6:57                           ` Daniel Barkalow
2005-11-29  7:52                             ` Junio C Hamano [this message]
2005-11-29 13:39                               ` Matthias Urlichs
2005-11-29 17:31                                 ` Junio C Hamano
2005-11-29 17:22                               ` Daniel Barkalow
2005-11-29 19:28                                 ` Junio C Hamano
2005-11-29 21:44                                   ` Daniel Barkalow
2005-11-29 12:14                             ` Matthias Urlichs
2005-12-01  1:15   ` James Cloos
2005-12-01  2:43     ` 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=7v8xv7lwlr.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=pasky@suse.cz \
    --cc=torvalds@osdl.org \
    /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).