Changeset 3445


Ignore:
Timestamp:
Sep 27, 2024, 6:54:42 PM (8 weeks ago)
Author:
afalco
Message:

general: git init script to install hook by a copy
instead of a link.
Accept automatically the copy.
AF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/git_init.sh

    r3414 r3445  
    1 # Script to initialize the git repository and link it to the svn.
    2 # The synchronization requires two pushes
    3 # (1st push=svn dcommit, 2nd push=git push)
    4 # WARNING: we assume the svn and the git are up-to-date
     1## Script to initialize the git repository and link it to the svn.
     2## The synchronization requires two pushes
     3## (1st push=svn dcommit, 2nd push=git push)
     4## WARNING: we assume the svn and the git are up-to-date
     5## https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Git-svn
     6
    57SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
    68cd ${SCRIPT_DIR}/..
    79
    8 echo "WARNING: this script will setup the git repo"
    9 echo "or download it in the git-trunk/ folder (and link with git-svn)."
     10echo "WARNING: this script will setup the git repository."
     11echo "It will connect the git to the svn (git svn init) and"
     12echo "install a hook to ensure the synchronization between the two."
     13echo "The hook (UTIL/pre-push) will be called at each git push."
     14# echo "or download it in the git-trunk/ folder (and link with git-svn)."
    1015
    1116while true; do
    12     read -p "Do you wish to continue? [y/n] " yn
     17    read -p "Do you wish to continue? [Y/n] " yn
    1318    case $yn in
    1419        [Yy]* ) break;;
    1520        [Nn]* ) exit;;
    16         * ) echo "Please answer yes (y) or no (n).";;
     21        * ) break;;
    1722    esac
    1823done
    1924
    20 URL=git@gitlab.in2p3.fr:la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk.git
    21 LOCAL_URL=`git remote get-url origin 2>/dev/null`
    22 if [ "${LOCAL_URL}" !=  "${URL}" ];then
    23     git clone ${URL}
    24     cd git-trunk
    25 fi
     25# URL=git@gitlab.in2p3.fr:la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk.git
     26# LOCAL_URL=`git remote get-url origin 2>/dev/null`
     27# if [ "${LOCAL_URL}" !=  "${URL}" ];then
     28#     git clone ${URL}
     29#     cd git-trunk
     30# fi
    2631
    27 # link svn to git as git-svn branch
    28 # (need git-svn to work)
     32### link svn to git as git-svn branch
     33### (need git-svn to work)
    2934git svn init https://svn.lmd.jussieu.fr/Planeto/trunk
    3035
     
    3237# git svn rebase # not used (we assume we're up-to-date)
    3338
    34 # install pre-push hook to ensure
    35 # users push only commits in sync with svn
     39### install pre-push hook to ensure
     40### users push only commits in sync with svn
    3641
    37 ln UTIL/pre-push .git/hooks
     42cp UTIL/pre-push .git/hooks
     43
Note: See TracChangeset for help on using the changeset viewer.