git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Patrick Doyle" <wpdster@gmail.com>
To: "Steve French" <smfrench@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git-svnexport
Date: Thu, 5 Jul 2007 09:50:27 -0400	[thread overview]
Message-ID: <e2a1d0aa0707050650m729018f0x9e355ed23e8156af@mail.gmail.com> (raw)
In-Reply-To: <524f69650707031231y2ab7b9a3o7769f64b9876326@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]

On 7/3/07, Steve French <smfrench@gmail.com> wrote:
> I noticed a git-svnexport, but don't see an easy way to do the more
> common task ... export a replica (via svn) of a kernel directory whose
> master copy is in git (no changes come through svn, all changes come
> through git).
>
> The Samba team (jra and others) use svn and would like me to keep more
> uptodate the svn branch (which I sync manually now by applying the
> patches from the kernel git tree by hand) for the two cifs git trees.
> Basically I need to do something like:
>
> git log fs/cifs
> save off each of the commits which hit fs/cifs which are not in the svn tree yet
> patch and "svn checkin" each of the commits to the svn tree
>
>
> Has anyone done any scripts to --- export -- to an svn tree from part
> of a git tree?
> I don't want to go to having my svn tree as the master and import into
> git from svn.
>
If you're interested I (may) have attached a script I was using to
learn how to import a git maintained project into a subversion
maintained project.  It is obviously a "play with this and try this
out" script, not a production script in any sense of the word, but it
might help point you in the direction you want to go.

The gist of the script is that I used .git/info/grafts to graft the
chain of git commits from my other project onto the most recent commit
from the svn maintained project (fetched via "git-svn clone") and then
I committed the result back to SVN.  All of the cruft around that is
simply, "blow away what I tried before and start from scratch all over
again" cruft I used when I was testing the concept.

hth

--wpd

[-- Attachment #2: git-graft-test2 --]
[-- Type: application/octet-stream, Size: 1068 bytes --]

#!/bin/sh
set -e
set -x

# Blow away the test directories
rm -rf sdrgen wpd sdrgen.orig.git mypack

# Now make fresh working directories, "wpd" is the subversion repo,
# ../vid_proj/sdrgen is where I've been doing all of my work to date.
cp -a wpd.orig wpd
cp -a ../vid_proj/sdrgen sdrgen.orig.git

# Fetch the SVN repository as a GIT repository
git-svn clone file:///home/wpd/git-svn-tests/wpd/sdrgen

# Start working in the new repo
cd sdrgen

# Pull in the original git repo as a branch
git-fetch ../sdrgen.orig.git master:original
FIRST_COMMIT=`git-rev-list original | tail -1`

TOPDIR=`git-rev-parse master`

# Now, graft the first commit from the other repository onto the last
# commit of this repo
echo $FIRST_COMMIT $TOPDIR > .git/info/grafts

# Change the "master" branch to point to the head of our newly imported
# chain of commits.
git-reset --hard original

# We're done with the original branch now
git-branch -d original

# Commit all of the changes back to the SVN repository
git-svn dcommit

# We're done with the grafts file now
rm .git/info/grafts

      reply	other threads:[~2007-07-05 13:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-03 19:31 git-svnexport Steve French
2007-07-05 13:50 ` Patrick Doyle [this message]

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=e2a1d0aa0707050650m729018f0x9e355ed23e8156af@mail.gmail.com \
    --to=wpdster@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=smfrench@gmail.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).