Changeset 3415 for trunk/UTIL


Ignore:
Timestamp:
Aug 21, 2024, 3:46:57 PM (4 months ago)
Author:
afalco
Message:

git-svn: pre-push hook launched from other branches too. AF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/pre-push

    r3414 r3415  
    33
    44# check if on master
    5 if [ $(git branch --show-current) != "master" ]; then
    6     exit 0 # if on other branch, do not care about the rest of the hook
    7     # git checkout master # ensure master sync with svn
     5local_branch=$(git branch --show-current)
     6if [ ${local_branch} != "master" ]; then
     7    git checkout master # ensure master is in sync with svn
    88fi
    99# git update-ref refs/remotes/git-svn refs/remotes/origin/master # what's this supposed to do?
     
    1515then
    1616    printf "${RED}You need to install git svn to use this script.${NC}\n"
     17    git checkout ${local_branch}
    1718    exit $GITSVN
    1819fi
     
    2829then
    2930    echo "${RED}git svn rebase failed.${NC}\n"
     31    git checkout ${local_branch}
    3032    exit $REBASED
    3133fi
     
    4850then
    4951    printf "${RED}git svn dcommit failed.${NC}\n"
     52    git checkout ${local_branch}
    5053    exit $COMMITED
    5154fi
     
    6366    printf "${RED}And synchronize svn and git.${NC}\n"
    6467    printf "${RED}You will need to push again after.${NC}\n"
     68    git checkout ${local_branch}
    6569    exit 1
    6670fi
     
    6973
    7074# push only if svn was already up to date with local master
     75git checkout ${local_branch}
    7176exit 0
Note: See TracChangeset for help on using the changeset viewer.