[asterisk-dev] following asterisk with git-svn
Tzafrir Cohen
tzafrir.cohen at xorcom.com
Mon Mar 2 12:45:11 CST 2009
Hi
On Tue, Feb 17, 2009 at 12:18:23AM +0200, Tzafrir Cohen wrote:
> Hi
>
> git-svn is an interface for the git version control system
> (http://git-scm.com/) . It basically creates a git copy of a subversion
> repository.
In the previous post I cloned the Asterisk repository with git. This
time let's look at a simpler task: dahdi-tools.
dahdi-tools has basically the same problem: the svn:external menuselect.
But it is generally much smaller and simpler.
So here is the adapted procedure. Note that I cheat.
# select a place under which to download the dahdi-tools tree.
git svn clone -s http://svn.digium.com/svn/dahdi/tools dahdi-tools
(Again, format is similar to 'svn checkout'. Do not confuse 'git
checkout' with 'svn checkout')
# This will download the whole /trunk , /tags and /branches hirarchies
# to a new git repository under asterisk/ .
# This will take some time. If it stops: in the middle:
#cd dahdi-tools; git svn fetch --fetch-all
# Next make your repository more compact:
# FIXME: I now get a .git subdirectory of the size of 135MB . This seems
# overly large considering what I got a few monthes ago
git repack -afd
# Now fix the menuselect bits. Here I cheat. menuselect controls
# exactly two dependencies: disabling sethdlc on some ancient systems,
# and disabling dahdi_tool if there's no newt. I just make sure the hard
# way I have both. At some stage it may bother me more and I'll adapt
# dummy-select.
> # One possible venue is to use submodules.
> # This would require setting a separate menuselect repository . And
> # fixing the submodule references in every new tag to point to the right
> # place. I gave up at this stage, and instead reimplememented menuselect
>
mkdir menuselect
svn export http://svn.digium.com/svn/menuselect/trunk/contrib/Makefile-dummy menuselect/Makefile
#svn export http://svn.digium.com/svn/menuselect/trunk/contrib/menuselect-dummy menuselect/menuselect
make -C menuselect dummies
ln -s /bin/true menuselect/menuselect
#chmod +x menuselect/menuselect
# Next thing to do is ignore generated files. .gitignore is somewhat
# like svn:ignore . Though it is possible to use one at the top
# directory. Hence I decided to make it ignore itself as well:
cat <<EOF >.gitignore
# Ignoring .gitignore itself:
.gitignore
*.a
*.so
*.o
*.lo
*.o.d
*.lo.d
# For VIM users:
.*.swp
build_tools/menuselect-deps
config.log
config.status
dahdi_cfg
dahdi_diag
dahdi_monitor
dahdi_scan
dahdi_speed
dahdi_test
dahdi_tool
fxotune
fxstest
hdlcgen
hdlcstress
hdlctest
hdlcverify
makeopts
menuselect-tree
menuselect/
patgen
patlooptest
pattest
sethdlc
timertest
version.c
xpp/dahdi_genconf.8
xpp/dahdi_hardware.8
xpp/dahdi_registration.8
xpp/fpga_load
xpp/lsdahdi.8
xpp/perlcheck
xpp/test_parse
xpp/xpp_blink.8
xpp/xpp_sync.8
EOF
# Now let's generate tags that will point to the tags/* branches.
# e.g. tag 'v2.1.0.2' will point to the head of branch tags/2.1.0.2 .
# If you don't like the extra 'v', just edit the sed command.
git branch -r | grep tags/1 | sed -e 's"tags/\(.*\)"& v\1"' \
| while read branch tag; do git tag $tag $branch; done
--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
More information about the asterisk-dev
mailing list