1
0
Fork 0

Autocommitted updated scripts from mari-wovn

main
Mari 5 years ago
parent 77e84cf68d
commit 867e2ac1ea
  1. 1
      nvim/init.vim
  2. 26
      per-host/mari-wovn/.bash_aliases

@ -1,3 +1,4 @@
set runtimepath^=~/.vim runtimepath+=~/.vim/after set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath let &packpath = &runtimepath
source ~/.vimrc source ~/.vimrc
set synmaxcol=100

@ -43,12 +43,15 @@ function _start_branch() {
git push --set-upstream origin "feature/${branch}" git push --set-upstream origin "feature/${branch}"
fi fi
git worktree add ../"${branch}" "feature/${branch}" || exit "$?" git worktree add ../"${branch}" "feature/${branch}" || exit "$?"
else
printf "=== Accessing an existing branch named ${branch}...\n"
fi
cd ~/equalizer/"${branch}" || exit "$?" cd ~/equalizer/"${branch}" || exit "$?"
wovn_update || exit "$?" wovn_update || exit "$?"
printf "\a=== Your branch ${branch} is ready!\n" printf "\a=== Your branch ${branch} is ready!\n"
else
printf "=== Accessing an existing branch named ${branch}...\n"
cd ~/equalizer/"${branch}" || exit "$?"
wovn_check_update || printf "=== Some updates are necessary.\n"
printf "\a=== Ready to start using branch ${branch}!\n"
fi
) )
if [[ -d ~/equalizer/"$branch" ]]; then if [[ -d ~/equalizer/"$branch" ]]; then
cd ~/equalizer/"${branch}" cd ~/equalizer/"${branch}"
@ -67,7 +70,7 @@ function get_remote_branch_name() {
function wovn_pull() { function wovn_pull() {
( (
printf "=== Retrieving the latest data from the repository...\n" printf "=== Updating local tracking branches...\n"
cd ~/equalizer/master || exit "$?" cd ~/equalizer/master || exit "$?"
git pull || exit "$?" git pull || exit "$?"
cd ~/equalizer/develop || exit "$?" cd ~/equalizer/develop || exit "$?"
@ -77,13 +80,26 @@ function wovn_pull() {
) )
} }
function wovn_check_update() {
(
printf "=== Retrieving the latest data from the repository...\n"
cd "$(git rev-parse --show-toplevel)"
git fetch --all || exit "$?"
git log --graph --oneline --simplify-by-decoration --decorate-refs=refs/{remotes/origin,heads}/{develop{,_front},master,$(get_current_branch_name)} "^$(git merge-base {master,develop{,_front}}^1)" origin/{develop{_front,},master} $(get_current_branch_name) $(get_remote_branch_name)
{ [[ "$(git rev-parse master)" == "$(git rev-parse origin/master)" ]] \
&& [[ "$(git rev-parse develop_front)" == "$(git rev-parse origin/develop_front)" ]] \
&& [[ "$(git rev-parse develop)" == "$(git rev-parse origin/develop)" ]] \
&& git merge-base --is-ancestor origin/develop_front $(get_current_branch_name); } || exit "$?"
)
}
function wovn_update() { function wovn_update() {
( (
cd "$(git rev-parse --show-toplevel)" cd "$(git rev-parse --show-toplevel)"
# set -o errexit # Can't do this inside a function # set -o errexit # Can't do this inside a function
set -o nounset set -o nounset
set -o pipefail set -o pipefail
wovn_pull wovn_check_update || wovn_pull
printf "=== Updating the branch...\n" printf "=== Updating the branch...\n"
git rebase develop_front || exit "$?" git rebase develop_front || exit "$?"
printf "=== Checking dependencies...\n" printf "=== Checking dependencies...\n"

Loading…
Cancel
Save