* git-svnexport
@ 2007-07-03 19:31 Steve French
2007-07-05 13:50 ` git-svnexport Patrick Doyle
0 siblings, 1 reply; 2+ messages in thread
From: Steve French @ 2007-07-03 19:31 UTC (permalink / raw)
To: git
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.
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: git-svnexport
2007-07-03 19:31 git-svnexport Steve French
@ 2007-07-05 13:50 ` Patrick Doyle
0 siblings, 0 replies; 2+ messages in thread
From: Patrick Doyle @ 2007-07-05 13:50 UTC (permalink / raw)
To: Steve French; +Cc: git
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-05 13:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-03 19:31 git-svnexport Steve French
2007-07-05 13:50 ` git-svnexport Patrick Doyle
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).