|
|
|
@ -55,30 +55,43 @@ function s_clean {
|
|
|
|
|
# VPN
|
|
|
|
|
alias vpn="sudo openvpn --config $HOME/Nextcloud/#\ -\ Configs/rguiheneuf.ovpn"
|
|
|
|
|
|
|
|
|
|
# Git
|
|
|
|
|
alias gst='git status'
|
|
|
|
|
# ╔═╗┬┌┬┐ ╔═╗┬ ┬┌─┐┌─┐┌─┐┌─┐
|
|
|
|
|
# ║ ╦│ │ ╠═╣│ │├─┤└─┐├┤ └─┐
|
|
|
|
|
# ╚═╝┴ ┴ ╩ ╩┴─┘┴┴ ┴└─┘└─┘└─┘
|
|
|
|
|
alias gs='git status'
|
|
|
|
|
alias gc='git checkout'
|
|
|
|
|
alias gcm='git checkout master'
|
|
|
|
|
alias gpl='git pull'
|
|
|
|
|
alias gph='git push'
|
|
|
|
|
alias pull='git pull'
|
|
|
|
|
alias push='git push'
|
|
|
|
|
alias gsu='git submodule update --init'
|
|
|
|
|
alias gcp='git cherry-pick'
|
|
|
|
|
|
|
|
|
|
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'
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
@ -91,48 +104,65 @@ function tag_replace {
|
|
|
|
|
git push origin $1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function grb {
|
|
|
|
|
git rebase -i HEAD~$1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function g_save {
|
|
|
|
|
git add *
|
|
|
|
|
git commit -m "[skip ci] Save: do not merge"
|
|
|
|
|
git push -f
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function grbm {
|
|
|
|
|
# Save actual branch
|
|
|
|
|
# ╔═╗┬┌┬┐ ╦═╗┌─┐┌┐ ┌─┐┌─┐┌─┐
|
|
|
|
|
# ║ ╦│ │ ╠╦╝├┤ ├┴┐├─┤└─┐├┤
|
|
|
|
|
# ╚═╝┴ ┴ ╩╚═└─┘└─┘┴ ┴└─┘└─┘
|
|
|
|
|
function grb {
|
|
|
|
|
git rebase -i HEAD~$1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function grbi {
|
|
|
|
|
# Save current branch
|
|
|
|
|
BRANCH=$(git branch | grep \* | cut -d ' ' -f2)
|
|
|
|
|
|
|
|
|
|
# Checkout master & pull
|
|
|
|
|
git checkout master
|
|
|
|
|
# Save parent branch
|
|
|
|
|
PARENT=$(git_parent)
|
|
|
|
|
|
|
|
|
|
# Checkout parent & pull
|
|
|
|
|
git checkout ${PARENT}
|
|
|
|
|
git pull
|
|
|
|
|
|
|
|
|
|
echo "Rebasing on" ${PARENT}
|
|
|
|
|
|
|
|
|
|
# Back to previous branch
|
|
|
|
|
git checkout ${BRANCH}
|
|
|
|
|
git rebase -i master
|
|
|
|
|
git rebase --interactive ${PARENT}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function grbr {
|
|
|
|
|
function grbroot {
|
|
|
|
|
git rebase --interactive --autosquash --root
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function gam {
|
|
|
|
|
git autofixup master
|
|
|
|
|
git rebase --interactive --autosquash master
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ga {
|
|
|
|
|
git autofixup HEAD~$1
|
|
|
|
|
git rebase --interactive --autosquash HEAD~$1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Git amend
|
|
|
|
|
function gai {
|
|
|
|
|
# Save parent branch
|
|
|
|
|
PARENT=$(git_parent)
|
|
|
|
|
|
|
|
|
|
echo "Rebasing with autofixup on" ${PARENT}
|
|
|
|
|
|
|
|
|
|
git autofixup ${PARENT}
|
|
|
|
|
git rebase --interactive --autosquash ${PARENT}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# ╔═╗┬┌┬┐ ╔═╗┌┬┐┌─┐┌┐┌┌┬┐
|
|
|
|
|
# ║ ╦│ │ ╠═╣│││├┤ │││ ││
|
|
|
|
|
# ╚═╝┴ ┴ ╩ ╩┴ ┴└─┘┘└┘─┴┘
|
|
|
|
|
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'
|
|
|
|
@ -141,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'
|
|
|
|
@ -204,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
|
|
|
|
|
|
|
|
|
|