Changes between Version 4 and Version 5 of Doc/SCDB/Git


Ignore:
Timestamp:
Feb 24, 2010, 4:08:41 PM (16 years ago)
Author:
/O=GRID-FR/C=FR/O=CNRS/OU=LAL/CN=Michel Jouvin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Doc/SCDB/Git

    v4 v5  
    5959If you use `svn:externals` in your configuration database to refer to some common parts or some of the deployment tools, this requires additional steps. [http://git-scm.com Git], as other DVCS, has no support for external references. But, through the ''submodule'' feature, it is possible to somewhat emulate the SVN feature.
    6060
    61 The solution is a bit tricky  but is well described at http://kerneltrap.org/mailarchive/git/2007/5/1/245002. The idea is to fetch each external as a separate branch in the Git repository and create submodules, one for each external, by cloning the repository itself, hacking a few files so that they refer to the same as in the main repository and change the branch used for each submodule to the appropriate one.
    62  
     61The solution is a bit tricky  but is well described at http://kerneltrap.org/mailarchive/git/2007/5/1/245002. The idea is to fetch each external as a separate branch in the Git repository and create submodules, one for each external, by cloning the repository itself, hacking a few files so that they refer to the same as in the main repository and change the branch used for each submodule to the appropriate one. Typical steps involve:
     62 * Adding the SVN remote branches to be tracked for each tool. This is typically done by adding the following sections to `.git/config` (change the versions to whatever is appropriate):
     63{{{
     64[svn-remote "panc-8.2.11"]
     65        url = https://svn.lal.in2p3.fr/LCG/QWG
     66        fetch = /External/panc-8.2.11:refs/remotes/svn-panc-8.2.11
     67[svn-remote "ant-1.7.1"]
     68        url = https://svn.lal.in2p3.fr/LCG/QWG
     69        fetch = /External/apache-ant-1.7.1:refs/remotes/svn-ant-1.7.1
     70[svn-remote "saxonb-9.1.0.2J"]
     71        url = https://svn.lal.in2p3.fr/LCG/QWG
     72        fetch = /External/saxonb-9.1.0.2J:refs/remotes/svn-saxonb-9.1.
     73[svn-remote "scdb-ant-utils-8.0.1"]
     74        url = https://svn.lal.in2p3.fr/LCG/QWG
     75        fetch = /External/scdb-ant-utils-8.0.1:refs/remotes/svn-scdb-ant-utils-8.0.1
     76[svn-remote "svnkit-1.3.2"]
     77        url = https://svn.lal.in2p3.fr/LCG/QWG
     78        fetch = /External/svnkit-1.3.2:refs/remotes/svn-svnkit-1.3.2
     79}}}
     80 * Fetch each remote branch with the following command used for each `svn-remove` entry. Based on previous configuration, the commands will be
     81{{{
     82git svn fetch ant-1.7.1
     83git svn fetch panc-8.2.11
     84git svn fetch saxonb-9.1.0.2J
     85git svn fetch scdb-ant-utils-8.0.1
     86git svn fetch svnkit-1.3.2
     87}}}
     88 * Create a branch for tracking each of the remote branch:
     89{{{
     90git branch ant-1.7.1 svn-ant-1.7.1
     91git branch panc-8.2.11 svn-panc-8.2.11
     92git branch saxonb-9.1.0.2J svn-saxonb-9.1.0.2J
     93git branch scdb-ant-utils-8.0.1 svn-scdb-ant-utils-8.0.1
     94git branch svnkit-1.3.2 svn-svnkit-1.3.2
     95}}}
     96 * Create each `external/` directory and clone the repository into them (without checking it out). Following commands must be updated based on your actual configuration:
     97{{{
     98mkdir external
     99for rep in ant panc saxon svnkit scdb-ant-utils; do git clone -n -s . external/$rep; done
     100}}}
     101 * Go into each directory and do the following using the appropriate branch created previously:
     102{{{
     103rm -rf .git/refs .git/logs .git/info .git/description .git/config
     104ln -s ../../.git/refs .git/refs
     105ln -s ../../.git/logs .git/logs
     106ln -s ../../.git/info .git/info
     107ln -s ../../.git/config .git/config
     108ln -s ../../.git/description .git/description
     109#Use the appropriate branch name for each subdirectory
     110git checkout ant-1.7.1
     111}}}
     112
    63113== Using Git for Everyday Operations == #GitEveryDay
    64114