My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/usr/bin/env bash
  2. #
  3. # mfup
  4. #
  5. # - Fetch latest upstream and replace the PR Target branch with
  6. # - Rebase the (current or specified) branch on the PR Target
  7. # - Force-push the branch to 'origin'
  8. #
  9. [[ $# < 3 ]] || { echo "Usage: `basename $0` [1|2] [branch]" 1>&2 ; exit 1; }
  10. MFINFO=$(mfinfo "$@") || exit 1
  11. IFS=' ' read -a INFO <<< "$MFINFO"
  12. ORG=${INFO[0]}
  13. FORK=${INFO[1]}
  14. REPO=${INFO[2]}
  15. TARG=${INFO[3]}
  16. BRANCH=${INFO[4]}
  17. CURR=${INFO[5]}
  18. set -e
  19. # Prevent accidental loss of current changes
  20. [[ $(git stash) != "No local "* ]] && HAS_STASH=1
  21. echo "Fetching upstream ($ORG/$REPO)..."
  22. git fetch upstream
  23. if [[ $BRANCH != $TARG ]]; then
  24. echo ; echo "Rebasing $BRANCH on $TARG..."
  25. if [[ $BRANCH == $CURR ]] || git checkout $BRANCH; then
  26. if git rebase upstream/$TARG; then
  27. git push -f
  28. else
  29. echo "Looks like merge conflicts. Stopping here."
  30. exit
  31. fi
  32. else
  33. echo "No such branch!"
  34. fi
  35. fi
  36. echo
  37. [[ $BRANCH != $CURR ]] && git checkout $CURR
  38. [[ $HAS_STASH == 1 ]] && git stash pop