Guest User

Untitled

a guest
Sep 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.01 KB | None | 0 0
  1. #/bin/sh
  2.  
  3. # for update hook
  4. # call % <repo> $refname $newrev
  5.  
  6. set -x
  7.  
  8. repository=$1
  9. branch=$2
  10. newrev=$3
  11. _git=/usr/local/git/bin/git
  12.  
  13. OLD_GIT_DIR=$GIT_DIR
  14. cd ../Split
  15. GIT_DIR=`pwd`/.git
  16.  
  17. # HEAD of my --bare repository.
  18. oldref=`$_git symbolic-ref HEAD`
  19.  
  20. # New HEAD is $branch.
  21. $_git symbolic-ref HEAD $branch
  22. status=$?
  23. if test 0 -ne $status; then exit $status; fi
  24.  
  25. # New branch (useful for the log).
  26. #$_git branch auto-markup-$repository
  27. checkpoint=git symbolic-ref
  28.  
  29. # Pull!
  30. $_git subtree pull --prefix=Library/$repository ../$repository $newrev
  31.  
  32. # Rewrite last commit message.
  33. $_git commit --amend -m "[auto] Merge from $repository
  34.  
  35. `$_git log --pretty=format:'    • #%h — %s (%an, %cd)' --reverse --date=short \
  36.     $checkpoint..HEAD\^2`
  37.  
  38. ---
  39.  
  40. `$_git log -1 --pretty=format:'%B'`"
  41.  
  42. # Remove branch.
  43. #$_git branch -d auto-markup-$repository
  44.  
  45. # Replace new HEAD.
  46. $_git symbolic-ref HEAD $oldref
  47. status=$?
  48. if test 0 -ne $status; then exit $status; fi
  49.  
  50. GIT_DIR=$OLD_GIT_DIR
  51.  
  52. set +x
Add Comment
Please, Sign In to add comment