Commit 64dc033040f8c321d41142ebb139a4af3d9a2109

Make b and B commands work with submodules
Author: xaizek
Author date (UTC): 2021-09-26 14:15
Committer name: xaizek
Committer date (UTC): 2021-09-26 14:15
Parent(s): 13eaab75737b103210df7dcebf7f904f3f472f2b
Signing key: 99DC5E4DB05F6BE2
Tree: 2b7b4869558bc28c188e234c8a38a322d86e5c03
File Lines added Lines deleted
bashrc 2 16
File bashrc changed (mode: 100644) (index 1daf189..6c24000)
... ... fi
631 631 # echoes full specification of the current branch # echoes full specification of the current branch
632 632 function B() function B()
633 633 { {
634 local CUR_DIR="$PWD"
635 while [ -n "$CUR_DIR" -a ! -d "${CUR_DIR}/.git" ]; do
636 if [ "$CUR_DIR" = '/' ]; then
637 break
638 fi
639 if [ "${CUR_DIR:1:3}" = ':/' -o "${CUR_DIR:1:3}" = ':' ]; then
640 break
641 fi
642
643 CUR_DIR=${CUR_DIR%/*}
644 done
645
646 if [ -d "${CUR_DIR}/.git" ]; then
647 local branch="$(<$CUR_DIR/.git/HEAD)"
648 echo -n "${branch#*: }"
649 fi
634 # `echo` is just to get rid of a newline
635 echo -n "$(git rev-parse --symbolic-full-name HEAD)"
650 636 } }
651 637
652 638 # echoes basename of the current branch # echoes basename of the current branch
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/dotfiles

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/dotfiles

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master