Browse Source

heck_git_ui

master
heck 8 months ago
parent
commit
a62bbb0ed9
  1. 43
      bash_profile.d/git.sh

43
bash_profile.d/git.sh

@ -1,25 +1,13 @@
#!/bin/bash
# git
function heck_git_ui {
# git basic
alias gf='git fetch --all --tags'
alias gp='git pull'
# git push
alias gpush='git push'
alias gpushf='git push --force'
alias gpusht='gpush; gpush --tags'
alias gpushtf='gpushf;gpushf --tags'
# --all / -u
alias gpau='gpush --all -u'
alias gpu='gpush -u'
alias gpauf='gpushf --all -u'
alias gpuf='gpushf -u'
# with tags
alias gpaut='gpush --all -u;gpusht'
alias gput='gpush -u;gpusht'
alias gpauft='gpushf --all -u;gpushtf'
alias gpuft='gpushf -u;gpushtf'
alias gs='git status --long'
alias gd='git diff'
alias gt='git tag'
@ -36,14 +24,15 @@ alias gco='git checkout'
alias gc='git commit'
alias gup='git pull --rebase --autostash -v'
alias gcp='git cherry-pick'
alias gclean='git clean -dxf'
# stats
alias gstats='git shortlog -sne'
function gstatslines() {
echo -e "this usually takes a while.\nSo, go grab a coffee... or two... or three...";
echo -e "this usually takes a while.\nSo, go grab a coffee... or two... or three..."
git ls-files | while read f; do {
git blame -wMCC --line-porcelain $f | grep -I '^author ';
} done | sort -f | uniq -ic | sort -n --reverse
git blame -wMCC --line-porcelain $f | grep -I '^author '
}; done | sort -f | uniq -ic | sort -n --reverse
}
function gstats_libpEpAdapter_heck() {
@ -51,5 +40,23 @@ function gstats_libpEpAdapter_heck() {
echo "$(gstatslines | grep 'author heck' | cut -f1 -d' ') - $(cat src/sqlite3.c src/internal/sqlite3.h | wc -l)" | bc
}
alias gstatsall='gstats;gstatslines'
# submodule
alias gsubpush='git submodule foreach "git push || :"'
function heck_git_ui_deprecated {
# --all / -u
alias gpau='gpush --all -u'
alias gpu='gpush -u'
alias gpauf='gpushf --all -u'
alias gpuf='gpushf -u'
# with tags
alias gpaut='gpush --all -u;gpusht'
alias gput='gpush -u;gpusht'
alias gpauft='gpushf --all -u;gpushtf'
alias gpuft='gpushf -u;gpushtf'
}
}
heck_git_ui
Loading…
Cancel
Save