all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: Ken Raeburn <raeburn@raeburn.org>
Cc: David Reitter <david.reitter@gmail.com>,
	"emacs-devel@gnu.org discussions" <emacs-devel@gnu.org>
Subject: Re: Git mirror - bidrectional
Date: Thu, 14 Jan 2010 01:52:37 +0900	[thread overview]
Message-ID: <87wrzm0wx6.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <50BB0D44-FCA5-40C1-BDF7-87D1EE77551D@raeburn.org>

Ken Raeburn writes:

 > Does git have sufficient hooks to push back submitted changes to bzr  
 > in real time,

Probably.  There have been some more or less feeble attempts to create
bound branches in git with the post-commit hook.  That might be
usable.  There is also a post-update hook for push (see "git help
receive-pack").

 > and detect conflicts at that point,

Any conflicts in pushing to the bzr mainline will be detected by bzr,
before anything gets pushed to bzr.  But to get to that point, the
merge needs to have succeeded in the git mirror.

 > and report an error to the client without updating the git mirror
 > (aside from maybe some new commits unreferenced by branch labels)?

I think that would you would need is two refs per branch, one public
and one for the use of the mirror only.  Maybe even three (a public
read-only branch updated by the bzr->git process, a public write-only
branch whose only reader should be the git-bzr branch, and a private
ref used for locking as below).  (Note that something like this
three-branch method is how git remotes are currently implemented.  But
at this point I'm to tired to work out whether it would be an
improvement in any of the failure states.)

To update bzr, the git/bzr repo's post-update hook will

1.  Use "git branch -m public private" to lock the branch.  (Yes, we
    want readers locked out too, or you have a rebase fiasco when the
    bzr push fails.)  Before doing this, it should be verified that
    branch -m is atomic, but I can't imagine why the operation would
    exist if somebody didn't need it to be atomic.

2.  Tag the head.

3.  Push your new commits from local workspace to private.

4.  Push private to the bzr mainline with bzr.

5.  Delete the tag.

6.  Use "git branch -m private public" to unlock the branch.

If 4 fails, you recreate the public branch at the tag, delete the tag
and the private branch ref, and inform the user she lost.  Now you
have to resync the git mirror with bzr.

If 3 fails, you need to update local and try again.  First clean up by
recreating the public branch ref at the tag, delete the tag and
private branch ref.

If 1 fails, somebody else is updating, wait your turn.

2, 5, and 6 shouldn't fail unless git is buggy.

I think that should work, except that if 4 fails, resyncing to bzr
looks like it will need manual intervention.  It might not be that bad
if everybody who wants to use one of these implements their own, but
running one as a public service would probably be hairy.




  parent reply	other threads:[~2010-01-13 16:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-29  5:35 git mirror? Miles Bader
2009-12-29 11:47 ` Andreas Schwab
2009-12-29 18:30   ` Stefan Monnier
2009-12-30 13:17     ` Andreas Schwab
2010-01-05  3:47       ` Miles Bader
2010-01-05  9:24         ` Andreas Schwab
2010-01-05  9:30           ` Miles Bader
2009-12-30 13:10 ` Andreas Schwab
2010-01-12 19:27   ` Git mirror - bidrectional David Reitter
2010-01-13 15:12     ` Ken Raeburn
2010-01-13 16:15       ` David Reitter
2010-01-13 17:14         ` Stephen J. Turnbull
2010-01-13 19:16           ` David Reitter
2010-01-14  1:58             ` Ken Raeburn
2010-01-14  2:34               ` David Reitter
2010-01-13 16:52       ` Stephen J. Turnbull [this message]
2010-01-13 19:28     ` Dan Nicolaescu
2010-01-13 20:42       ` David Reitter
2010-01-14  4:12         ` Stefan Monnier
2010-01-13 23:29       ` Miles Bader

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=87wrzm0wx6.fsf@uwakimon.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=david.reitter@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=raeburn@raeburn.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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.