#!/bin/bash function heck_git_ui { # git basic alias gf='git fetch --all --tags' alias gp='git pull' alias gpush='git push' alias gpushf='git push --force' alias gpusht='gpush; gpush --tags' alias gpushtf='gpushf;gpushf --tags' alias gs='git status --long' alias gd='git diff' alias gt='git tag' alias gst='git for-each-ref --sort=creatordate --format "%(objectname) %(refname)" refs/tags' alias gb='git branch' alias gsb='git branch -vv --all' alias gl='git log --graph --date=iso --topo-order --source --oneline' alias gla='gl --all' alias gll='git log --graph --date=iso --stat --topo-order --source' alias glla='gll --all' alias gm='git merge --no-ff' alias grb='git rebase' 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..." git ls-files | while read f; do { git blame -wMCC --line-porcelain $f | grep -I '^author ' }; done | sort -f | uniq -ic | sort -n --reverse } function gstats_libpEpAdapter_heck() { echo "libpEpAdapter: corrected lines of code for author heck, because he commited the sqlite3 amalgamation..." 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 || :"' alias gsubinit='git submodule update --init' 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