1
0
Fork 0

Autocommitted updated scripts from mari-wovn

main
Mari 5 years ago
parent 29b77e46d3
commit 0c20123bcf
  1. 15
      per-host/mari-wovn/.bash_aliases

@ -14,7 +14,7 @@ function wovn_start() {
set -o pipefail
branch=${1:?}
branch=${branch#feature/}
tmux -2 new-window -a -t "Main Screen:1" -n "$branch" -c ~ -e BRANCH_NAME="$branch" 'bash -ic "_start_branch \"\$BRANCH_NAME\"; exec bash"'
tmux -2 new-window -t "Main Screen" -n "$branch" -c ~/branches -e BRANCH_NAME="$branch" 'bash -ic "_start_branch \"\$BRANCH_NAME\"; exec bash"'
)
}
@ -28,8 +28,7 @@ function _start_branch() {
if [[ ! -d ~/branches/"$branch" ]]; then
printf "=== Setting up a branch named ${branch}...\n"
cd ~/equalizer.git || exit "$?"
printf "=== Retrieving the latest data from the repository...\n"
git fetch --all || exit "$?"
wovn_pull
printf "=== Checking out the branch named feature/${branch} in a new working tree at ~/branches/${branch}...\n"
git worktree add -b "feature/${branch}" ~/branches/"${branch}" develop_front || git worktree add ~/branches/"${branch}" "feature/${branch}" || exit "$?"
else
@ -54,14 +53,22 @@ function get_remote_branch_name() {
git rev-parse --abbrev-ref --symbolic-full-name '@{u}'
}
function wovn_pull() {
printf "=== Retrieving the latest data from the repository...\n"
git fetch --all || return "$?"
git rebase origin/develop_front develop_front || return "$?"
git rebase origin/develop develop || return "$?"
git rebase origin/master master || return "$?"
}
function wovn_update() {
(
cd "$(git rev-parse --show-toplevel)"
# set -o errexit # Can't do this inside a function
set -o nounset
set -o pipefail
wovn_pull
printf "=== Updating the branch...\n"
git fetch --all || exit "$?"
if get_remote_branch_name >&/dev/null; then
git pull --rebase || exit "$?"
fi

Loading…
Cancel
Save