diff --git a/nvim/init.vim b/nvim/init.vim index f182e5b..716dadc 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -1,3 +1,4 @@ set runtimepath^=~/.vim runtimepath+=~/.vim/after let &packpath = &runtimepath source ~/.vimrc +set synmaxcol=100 diff --git a/per-host/mari-wovn/.bash_aliases b/per-host/mari-wovn/.bash_aliases index ff1dabd..e2a62b7 100644 --- a/per-host/mari-wovn/.bash_aliases +++ b/per-host/mari-wovn/.bash_aliases @@ -43,12 +43,15 @@ function _start_branch() { git push --set-upstream origin "feature/${branch}" fi git worktree add ../"${branch}" "feature/${branch}" || exit "$?" + cd ~/equalizer/"${branch}" || exit "$?" + wovn_update || exit "$?" + 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 - cd ~/equalizer/"${branch}" || exit "$?" - wovn_update || exit "$?" - printf "\a=== Your branch ${branch} is ready!\n" ) if [[ -d ~/equalizer/"$branch" ]]; then cd ~/equalizer/"${branch}" @@ -67,7 +70,7 @@ function get_remote_branch_name() { function wovn_pull() { ( - printf "=== Retrieving the latest data from the repository...\n" + printf "=== Updating local tracking branches...\n" cd ~/equalizer/master || exit "$?" git pull || 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() { ( cd "$(git rev-parse --show-toplevel)" # set -o errexit # Can't do this inside a function set -o nounset set -o pipefail - wovn_pull + wovn_check_update || wovn_pull printf "=== Updating the branch...\n" git rebase develop_front || exit "$?" printf "=== Checking dependencies...\n"