libav-merge-next-commit 637 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. if [ "$1" != "merge" -a "$1" != "noop" ]; then
  3. printf "Usage: $0 <merge|noop [REF_HASH]>\n"
  4. exit 0
  5. fi
  6. [ "$1" = "noop" ] && merge_opts="-s ours"
  7. nextrev=$(git rev-list libav/master --not master --no-merges | tail -n1)
  8. if [ -z "$nextrev" ]; then
  9. printf "Nothing to merge..\n"
  10. exit 0
  11. fi
  12. printf "Merging $(git log -n 1 --oneline $nextrev)\n"
  13. git merge --no-commit $merge_opts --no-ff --log $nextrev
  14. if [ "$1" = "noop" -a -n "$2" ]; then
  15. printf "\nThis commit is a noop, see $2\n" >> .git/MERGE_MSG
  16. fi
  17. printf "\nMerged-by: $(git config --get user.name) <$(git config --get user.email)>\n" >> .git/MERGE_MSG