Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/bin/sh
- # for update hook
- # call % <repo> $refname $newrev
- set -x
- repository=$1
- branch=$2
- newrev=$3
- _git=/usr/local/git/bin/git
- OLD_GIT_DIR=$GIT_DIR
- cd ../Split
- GIT_DIR=`pwd`/.git
- # HEAD of my --bare repository.
- oldref=`$_git symbolic-ref HEAD`
- # New HEAD is $branch.
- $_git symbolic-ref HEAD $branch
- status=$?
- if test 0 -ne $status; then exit $status; fi
- # New branch (useful for the log).
- #$_git branch auto-markup-$repository
- checkpoint=git symbolic-ref
- # Pull!
- $_git subtree pull --prefix=Library/$repository ../$repository $newrev
- # Rewrite last commit message.
- $_git commit --amend -m "[auto] Merge from $repository
- `$_git log --pretty=format:' • #%h — %s (%an, %cd)' --reverse --date=short \
- $checkpoint..HEAD\^2`
- ---
- `$_git log -1 --pretty=format:'%B'`"
- # Remove branch.
- #$_git branch -d auto-markup-$repository
- # Replace new HEAD.
- $_git symbolic-ref HEAD $oldref
- status=$?
- if test 0 -ne $status; then exit $status; fi
- GIT_DIR=$OLD_GIT_DIR
- set +x
Add Comment
Please, Sign In to add comment