Guest User

Untitled

a guest
Sep 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.71 KB | None | 0 0
  1. #/bin/sh
  2.  
  3. _git=`git`
  4. repository=$1
  5. branch=master
  6. working=`pwd`/../../../script/Central
  7.  
  8. # Move to Central unbare.
  9. OLD_GIT_DIR=$GIT_DIR
  10. cd $working
  11. GIT_DIR=?`pwd`/.git
  12.  
  13. $_git checkout $branch
  14.  
  15. # Get current SHA-1.
  16. checkpoint=`$_git rev-parse HEAD`
  17.  
  18. # generate commit message with merged history
  19. CUSTOM_MSG="[auto] Merge from repository
  20.  
  21. `$_git log --pretty=format:'    • #%h — %s (%an, %cd)' --reverse --date=short \
  22.    $checkpoint..lib-$repository/$branch`
  23.  
  24. ---
  25.  
  26. `$_git log -1 --pretty=format:'%B'`"
  27.  
  28. $_git fetch "lib-${repository}"
  29. # Merge!
  30. $_git merge -m "$CUSTOM_MSG" -Xprefix="Library/$repository" lib-$repository/$branch
  31.  
  32. # Push to Central bare.
  33. $_git push
  34.  
  35. # Reset.
  36. GIT_DIR=$OLD_GIT_DIR
Add Comment
Please, Sign In to add comment