From: Chris Shoemaker <c.shoemaker@cox.net>
To: Andy Parkins <andyparkins@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: svn:externals using git submodules
Date: Tue, 1 May 2007 11:07:24 -0400 [thread overview]
Message-ID: <20070501150724.GA20797@pe.Belkin> (raw)
In-Reply-To: <200705011121.17172.andyparkins@gmail.com>
On Tue, May 01, 2007 at 11:21:14AM +0100, Andy Parkins wrote:
> Hello,
>
> I've done this by hand as a proof of concept I suspect it would need loads of
> work in git-svn to do it properly. However, I thought I'd mention as part of
> my "success with submodules" reports.
That's truly interesting, Andy. Thanks for the encouraging report.
Please do keep us informed of anything more you conclude about this
approach. I'm sure some of the experts around here can respond with
the pros and cons of this technique.
For my part, I wonder if it can be simplified somehow; and I suspect
it doesn't work well with svn:externals that specify a particular
revision.
-chris
> ffmpeg is managed with svn; I like to track its development with git-svn.
> Works wonderfully except for one problem: they've made use of svn:externals
> for one component, libswscale. Previously I just regularly updated the
> libswscale subdirectory by checking out the latest copy (which is all that
> subversion does) and committing it to my own branch off upstream.
>
> With submodule support in git, it makes it possible to do a much better job.
> What I did was have two svn-remote sections in the config:
>
> [svn-remote "ffmpeg"]
> url = svn://svn.mplayerhq.hu/ffmpeg
> fetch = trunk:refs/remotes/ffmpeg-svn
>
> [svn-remote "libswscale"]
> url = svn://svn.mplayerhq.hu/mplayer
> fetch = trunk/libswscale:refs/remotes/libswscale-svn
>
> After running git-svn fetch; there are two independent branches in my
> repository:
>
> -- * -- * -- * -- * -- * (ffmpeg-svn)
> ---- * ----- * ------- * (libswscale-svn)
>
> Now, we fork from ffmpeg-svn and libswscale-svn to make non-tracking branches
> that can be committed to:
>
> $ git checkout -b master-ffm ffmpeg-svn
> $ git branch master-sws libswscale-svn
>
> Next, we create a shared clone of the repository as a subdirectory in that
> repository.
>
> $ git clone -s . libswscale
>
> Now we want that clone to be even more strongly linked to the parent - to the
> extent that they share the same refs, etc:
>
> $ cd libswscale
> $ rm -rf .git/refs .git/logs .git/info description config
> $ ln -s ../../.git/refs .git/refs
> $ ln -s ../../.git/logs .git/logs
> $ ln -s ../../.git/info .git/info
> $ ln -s ../../.git/config .git/config
> $ ln -s ../../.git/description .git/description
>
> Only HEAD and index are independent. Next we switch from the ffmpeg branch to
> the libswscale branch in this subdirectory:
>
> $ git checkout master-sws
>
> Now, we make the subdirectory a submodule in the parent:
>
> $ cd ..
> $ git add libswscale
> $ git commit -m "libswscale is now a submodule"
>
> How dangerous is this? I've made the repository it's own submodule and it
> shares the same refs, info and logs. LIVING ON THE EDGE MAN!
>
> You have to run two git-svn commands to sync with upstream:
>
> $ git-svn fetch ffmpeg
> $ git-svn fetch libswscale
>
> Then of course you would merge
>
> $ git merge ffmpeg-svn
> $ cd libswscale; git merge libswscale-svn; cd ..
> $ git commit -m "Sync with upstream"
>
> Personally I think that's pretty cool, this is significantly better than
> svn:externals because the particular revision of libswscale in use is
> recorded. Seriously - someone show me another VCS that can do that - I think
> git has actual magic powers :-)
>
> I dare say that git-svn could do much better because it could reconstruct the
> submodule history based on the repository dates and create the link in the
> tracking branch rather than having to do it manually at the end as I've done
> here. That would mean that the recorded submodule was right for all
> history - again, not the case for svn:externals, if you check out a previous
> version the external remains current.
>
>
>
> Andy
> --
> Dr Andy Parkins, M Eng (hons), MIET
> andyparkins@gmail.com
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2007-05-01 15:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-01 10:21 svn:externals using git submodules Andy Parkins
2007-05-01 15:07 ` Chris Shoemaker [this message]
2007-05-01 15:22 ` Shawn O. Pearce
2007-05-01 15:36 ` Chris Shoemaker
2007-05-01 15:40 ` Shawn O. Pearce
2007-05-01 18:36 ` Andy Parkins
2007-05-01 18:39 ` Andy Parkins
2007-05-01 19:17 ` Chris Shoemaker
2007-05-01 19:48 ` Andy Parkins
2007-05-01 20:23 ` Chris Shoemaker
2007-05-01 22:19 ` Linus Torvalds
2007-05-01 22:37 ` Junio C Hamano
2007-05-01 23:16 ` Shawn O. Pearce
2010-01-20 13:58 ` Michel Jouvin
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=20070501150724.GA20797@pe.Belkin \
--to=c.shoemaker@cox.net \
--cc=andyparkins@gmail.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.
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).