Compare commits

..

1 Commits

Author SHA1 Message Date
Robin-Charles GUIHENEUF
b77a13d25f rb 2020-10-22 18:08:34 +02:00

View File

@ -55,7 +55,9 @@ function s_clean {
# VPN
alias vpn="sudo openvpn --config $HOME/Nextcloud/#\ -\ Configs/rguiheneuf.ovpn"
# Git
# ╔═╗┬┌┬┐ ╔═╗┬ ┬┌─┐┌─┐┌─┐┌─┐
# ║ ╦│ │ ╠═╣│ │├─┤└─┐├┤ └─┐
# ╚═╝┴ ┴ ╩ ╩┴─┘┴┴ ┴└─┘└─┘└─┘
alias gs='git status'
alias gc='git checkout'
alias gcm='git checkout master'
@ -68,20 +70,28 @@ alias add='git add'
alias commit='git commit -m "To fixup"'
alias cont='git rebase --continue'
# Git cleaners
alias branch_clean='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d'
alias tag_clean='git tag -l | xargs git tag -d && git fetch -t'
alias git_parent='git show-branch | grep "[\*]" | grep -v `git rev-parse --abbrev-ref HEAD` | head -n1 | sed "s/.*\[\(.*\)\].*/\1/"'
function git_parent {
git log --pretty=format:"%D" HEAD^ | \ # Show log refs
grep -v "^$" | \ # Clear empty lines
sed "s/, /\n/g" | \ # One ref by line
grep -v "tag:[^,]*,*" | \ # Filter tag refs
head -n1 | \ # Keep only the last
sed "s/origin\/\([^,]*\)/\1/" # Local reference
}
alias log='git log --graph --decorate --oneline'
# Branch
function branch_create {
git checkout -b $1
git push -u origin $1
}
# Tag
alias tag_clean='git tag -l | xargs git tag -d && git fetch -t'
function tag_create {
git tag $1
git push origin $1
@ -100,6 +110,9 @@ function g_save {
git push -f
}
# ╔═╗┬┌┬┐ ╦═╗┌─┐┌┐ ┌─┐┌─┐┌─┐
# ║ ╦│ │ ╠╦╝├┤ ├┴┐├─┤└─┐├┤
# ╚═╝┴ ┴ ╩╚═└─┘└─┘┴ ┴└─┘└─┘
function grb {
git rebase -i HEAD~$1
}
@ -141,11 +154,15 @@ function gai {
git rebase --interactive --autosquash ${PARENT}
}
# Git amend
# ╔═╗┬┌┬┐ ╔═╗┌┬┐┌─┐┌┐┌┌┬┐
# ║ ╦│ │ ╠═╣│││├┤ │││ ││
# ╚═╝┴ ┴ ╩ ╩┴ ┴└─┘┘└┘─┴┘
alias amend_pro="GIT_EDITOR=true git rebase --preserve-merges --exec 'git commit --amend --author=\"Robin-Charles GUIHENEUF <rguiheneuf@netatmo.com>\"' $1"
alias amend_perso="GIT_EDITOR=true git rebase --preserve-merges --exec 'git commit --amend --author=\"Robin-Charles Guihéneuf <robin-charles@hotmail.fr>\"' $1"
# Repositories
# ╦═╗┌─┐┌─┐┌─┐┌─┐┬┌┬┐┌─┐┬─┐┬┌─┐┌─┐
# ╠╦╝├┤ ├─┘│ │└─┐│ │ │ │├┬┘│├┤ └─┐
# ╩╚═└─┘┴ └─┘└─┘┴ ┴ └─┘┴└─┴└─┘└─┘
alias bc='cd $HOME/Netatmo/embedded/firmware-bitcloud'
alias fw='cd $HOME/Netatmo/embedded/firmware'
alias nmr='cd $HOME/Netatmo/embedded/nmr'
@ -154,7 +171,7 @@ alias mag='cd $HOME/Netatmo/embedded/magellan'
alias nsp='cd $HOME/Netatmo/embedded/nsp'
alias mulot='cd $HOME/mulot/firmware'
# Repositories in editor
# In editor
alias c_bc='c $HOME/Netatmo/firmware-bitcloud.code-workspace'
alias c_fw='c $HOME/Netatmo/firmware.code-workspace'
alias c_nmr='c $HOME/Netatmo/nmr.code-workspace'
@ -217,18 +234,21 @@ else
fi
fi
# Autofixup
export PATH=$PATH:$HOME/.git-autofixup
# Netatmo
export NETATMO_WORK_DIR=$HOME/Netatmo
# ╔═╗─┐ ┬┌─┐┌─┐┬─┐┌┬┐
# ║╣ ┌┴┬┘├─┘│ │├┬┘ │
# ╚═╝┴ └─┴ └─┘┴└─ ┴
export PATH=$PATH:~/Netatmo/core/embedded-tools/Linux/flasher
export PATH=$PATH:~/Netatmo/core/generic-embedded/stm32_sbm
export PATH=$PATH:~/Netatmo/core/generic-embedded/stm32_dfu
export PATH=$PATH:~/Netatmo/embedded/firmware-bitcloud/toolchain/arm-none-eabi/bin
export PATH=$PATH:~/Netatmo/embedded/nmr/scripts/flash
# Autofixup
export PATH=$PATH:$HOME/.git-autofixup
# Netatmo
export NETATMO_WORK_DIR=$HOME/Netatmo
# Cargo binaries (navi)
export PATH=$PATH:$HOME/.cargo/bin