git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jose Gisbert <jose.gisbert@live.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Using git svn rebase at quarantine environment or a feasible alternative to synchronize git and svn repositories
Date: Mon, 1 Oct 2018 08:12:49 +0000	[thread overview]
Message-ID: <VI1PR0902MB2223EA3FC0ACE7E9AFB7A6ACE2EF0@VI1PR0902MB2223.eurprd09.prod.outlook.com> (raw)

Dear members of the Git community,

The enterprise I work for is planning to switch from svn to git.

Before the complete switch to git we have decided to implement a scenario
where the two SCMs live together, being the svn repository the reference. We
also want this scenario to be transparent for both SCM users.

I read the articles referenced at the end of the email and I come to the
following solution.

My proposal consists to import the svn repository to git using git svn and set
receive.denyCurrentBranch to updateInstead. Then install pre-receive and
post-receive hooks and set that repository as the central repository for git
users.

The pre-receive hook does git svn rebase and, if there is an update at the svn
repository, rejects the push and instructs the user to do git pull. The
post-receive hook does git svn dcommit to update the state of the svn
repository, then instructs the user to do git pull too.

Both scripts check the changes pushed are made at master before doing anything
and exit after performing these tasks. branches.master.rebase is set to merges
at the user repository to avoid the histories of the central and the user
repositories diverge after doing git svn dcommit.

However I'm stuck at this point because the pre-receive hook it's not allowed
to do git svn rebase because update refs are not allowed at the quarantine
environment. I was sure that I tried this solution with a past version of git
and it worked, but now I doubt this because the restriction to update refs at
quarantine environment was delivered at version 2.13, that dates from April
2017, if I'm not wrong.

I don't know if this solution could be implemented or is there a better way to
accomplish this kind of synchronization (I tried Tmate SubGit, but it didn't
work for me and I don't know if we will be willing to purchase a license).
Could you help me with this question?

I come here asking for help because I think this is the appropriate place to
do so. I apologise if this is not the case. Any help is welcome. If anything
needs to be clarified, please, ask me to do so. I can share with you the
source code of the hook scripts, if necessary.

Thanks in advance.

Regards,

Jose

- https://stackoverflow.com/q/5586993
- https://stackoverflow.com/q/2014422
- http://davidsouther.com/#/posts/2012/04/13/git-svn-dcommit-hooks/
- https://gist.github.com/DavidSouther/8dfc6575f4d3a293be7c

             reply	other threads:[~2018-10-01  8:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01  8:12 Jose Gisbert [this message]
2018-10-01  8:55 ` Using git svn rebase at quarantine environment or a feasible alternative to synchronize git and svn repositories Ævar Arnfjörð Bjarmason
2018-10-01 14:17   ` Jose Gisbert
2018-10-01 15:00     ` Ævar Arnfjörð Bjarmason
2018-10-02 10:29       ` Jose Gisbert
2018-10-01 14:53 ` Jeff King
2018-10-02 10:28   ` Jose Gisbert
2018-10-02 14:27     ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR0902MB2223EA3FC0ACE7E9AFB7A6ACE2EF0@VI1PR0902MB2223.eurprd09.prod.outlook.com \
    --to=jose.gisbert@live.com \
    --cc=git@vger.kernel.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 public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).