Changeset 3449 for trunk/UTIL


Ignore:
Timestamp:
Oct 3, 2024, 6:48:34 PM (7 weeks ago)
Author:
afalco
Message:

git-svn: don't enter the hook if on local branch and not pushing on master.
Also pull from remote master using rebase to keep linear history.
AF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/pre-push

    r3440 r3449  
    44# check if on master
    55local_branch=$(git branch --show-current)
     6
     7echo Branch: $local_branch
     8
     9echo done
    610if [ ${local_branch} != "master" ]; then
    711    # exit 0 # if on other branch than master, do not sync with svn
     12    use_hook=false
     13    while read local_ref local_oid remote_ref remote_oid; do
     14        # echo $local_ref $local_oid $remote_ref $remote_oid
     15        if test $local_ref = "refs/heads/master"; then
     16            use_hook=true
     17        fi
     18    done
     19    if test $use_hook = "false" ;then
     20        echo "Sync with svn not necessary, no changes in master to be pushed."
     21        echo "Continuing with push on $local_branch."
     22        exit 0 # push only on local branch
     23    fi
    824    git checkout master
    9     git pull origin master
     25    git pull --rebase origin master
    1026fi
     27
    1128# git update-ref refs/remotes/git-svn refs/remotes/origin/master # what's this supposed to do?
    1229
Note: See TracChangeset for help on using the changeset viewer.