From a62bbb0ed9f63c4802a5d1f1167251f896722590 Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 4 Sep 2024 11:35:52 +0200 Subject: [PATCH] heck_git_ui --- bash_profile.d/git.sh | 101 ++++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 47 deletions(-) diff --git a/bash_profile.d/git.sh b/bash_profile.d/git.sh index 754fbe7..5ba4662 100644 --- a/bash_profile.d/git.sh +++ b/bash_profile.d/git.sh @@ -1,55 +1,62 @@ #!/bin/bash -# git -alias gf='git fetch --all --tags' -alias gp='git pull' +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' -# 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' + # 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 + } -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' + 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 + } -# 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 -} + alias gstatsall='gstats;gstatslines' -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 -} + # 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' + } +} -alias gstatsall='gstats;gstatslines' +heck_git_ui \ No newline at end of file