New git helper scripts 'mfadd' and 'mfqp'
- `mfadd` adds and fetches a user’s fork of Marlin - `mfqp` invokes `git commit -m`, `mfrb`, `git push -f`
This commit is contained in:
parent
7b4c245de3
commit
78308b1c0b
2 changed files with 43 additions and 0 deletions
24
buildroot/share/git/mfadd
Executable file
24
buildroot/share/git/mfadd
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# mfadd
|
||||||
|
#
|
||||||
|
# Add a remote and fetch it
|
||||||
|
#
|
||||||
|
|
||||||
|
MFINFO=$(mfinfo) || exit
|
||||||
|
|
||||||
|
IFS=' ' read -a INFO <<< "$MFINFO"
|
||||||
|
|
||||||
|
REPO=${INFO[2]}
|
||||||
|
OLDBRANCH=${INFO[4]}
|
||||||
|
|
||||||
|
case "$#" in
|
||||||
|
1 ) USER=$1 ;;
|
||||||
|
* ) echo "Usage: `basename $0` [user]" 1>&2 ; exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Adding and fetching $USER..."
|
||||||
|
|
||||||
|
git remote add -f "$USER" "git@github.com:$USER/$REPO.git"
|
19
buildroot/share/git/mfqp
Executable file
19
buildroot/share/git/mfqp
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# mfqp
|
||||||
|
#
|
||||||
|
# Add all changed files, commit as "patch", do `mfrb` and `git push -f`
|
||||||
|
#
|
||||||
|
|
||||||
|
MFINFO=$(mfinfo) || exit
|
||||||
|
IFS=' ' read -a INFO <<< "$MFINFO"
|
||||||
|
|
||||||
|
case "$#" in
|
||||||
|
0 ) ;;
|
||||||
|
* ) echo "Usage: `basename $0`" 1>&2 ; exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
git add * .travis.yml
|
||||||
|
git commit -m "patch"
|
||||||
|
mfrb
|
||||||
|
git push -f
|
Reference in a new issue