mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-23 18:18:23 +03:00
sh: replace merge helper [ci skip]
Replaces the 'merge-and-update-solid' script with the simpler 'merge-with-custom-msg' which merges branches using a custom merge commit message. Maintainers may want to alias it locally via something like: git config alias.mu '!sh/merge-with-custom-msg' Then use it via: git mu SOME_BRANCH SOME_PR_NUMBER
This commit is contained in:
parent
fa4544406e
commit
baedc50567
@ -1,72 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
usage() {
|
||||
local error="$1"
|
||||
|
||||
cat >&2 <<EOF
|
||||
Usage:
|
||||
$0 BRANCH PULL_REQUEST
|
||||
|
||||
Synopsis:
|
||||
Useful script for merging a GitHub pull request, resolving any (solid) pill
|
||||
conflicts along the way.
|
||||
|
||||
Strips "origin" from branches.
|
||||
|
||||
Example:
|
||||
$0 origin/philip/jael-fix 1953
|
||||
|
||||
Yields:
|
||||
|
||||
Merge branch 'philip/jael-fix' (#1953)
|
||||
|
||||
* origin/philip/jael-fix:
|
||||
jael: process all ships in %full update
|
||||
|
||||
Signed-off-by: Jared Tobin <jared@tlon.io>
|
||||
|
||||
Error:
|
||||
-> $error
|
||||
EOF
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
args="$@"
|
||||
|
||||
if [[ -z "$args" ]]; then
|
||||
usage "No arguments specified."
|
||||
fi
|
||||
|
||||
REV=$1
|
||||
PR=$2
|
||||
|
||||
TARGET=$(echo $REV | sed s_origin/__)
|
||||
|
||||
MERGE_MSG="Merge branch '$TARGET' (#$PR)"
|
||||
|
||||
PIER="tmp_pill_zod"
|
||||
|
||||
cleanup () {
|
||||
if [ -e ./$PIER/.vere.lock ]
|
||||
then kill $(< ./$PIER/.vere.lock) || true;
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
git merge --no-ff --signoff --log -X ours -m "$MERGE_MSG" $REV
|
||||
|
||||
rm -rf $PIER
|
||||
urbit -d -F zod -B bin/solid.pill -A pkg/arvo -c $PIER
|
||||
|
||||
herb $PIER -P solid.pill -d '+solid'
|
||||
|
||||
mv solid.pill bin/solid.pill
|
||||
|
||||
git add bin/solid.pill
|
||||
git commit --amend --no-edit
|
||||
|
||||
cleanup
|
||||
|
||||
rm -rf $PIER
|
49
sh/merge-with-custom-msg
Executable file
49
sh/merge-with-custom-msg
Executable file
@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
usage() {
|
||||
local error="$1"
|
||||
|
||||
cat >&2 <<EOF
|
||||
Usage:
|
||||
$0 BRANCH PULL_REQUEST
|
||||
|
||||
Synopsis:
|
||||
Useful script for merging a GitHub pull request with a custom merge commit
|
||||
message.
|
||||
|
||||
Strips "origin" from branch names in title.
|
||||
|
||||
Example:
|
||||
$0 origin/philip/jael-fix 1953
|
||||
|
||||
Yields:
|
||||
|
||||
Merge branch 'philip/jael-fix' (#1953)
|
||||
|
||||
* origin/philip/jael-fix:
|
||||
jael: process all ships in %full update
|
||||
|
||||
Signed-off-by: Jared Tobin <jared@tlon.io>
|
||||
|
||||
Error:
|
||||
-> $error
|
||||
EOF
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
args="$@"
|
||||
|
||||
if [[ -z "$args" ]]; then
|
||||
usage "No arguments specified."
|
||||
fi
|
||||
|
||||
REV=$1
|
||||
PR=$2
|
||||
|
||||
TARGET=$(echo $REV | sed s_origin/__)
|
||||
|
||||
MERGE_MSG="Merge branch '$TARGET' (#$PR)"
|
||||
|
||||
git merge --no-ff --signoff --log -m "$MERGE_MSG" $REV
|
||||
|
Loading…
Reference in New Issue
Block a user