From 3fa39997a01145429d2497a60645399649c3185e Mon Sep 17 00:00:00 2001 From: Shubham Chaudhary Date: Wed, 21 Aug 2024 14:14:01 -0700 Subject: [PATCH] feat: Enhance git aliases and auto_commit script - Added alias for auto_commit with staged option. - Updated git show command in auto_commit to use fuller format. - Minor adjustments to existing git aliases for improved usability. --- home/.bash_aliases | 6 ++++-- scripts/bin/auto_commit | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/home/.bash_aliases b/home/.bash_aliases index c9d0c0d..1771b35 100644 --- a/home/.bash_aliases +++ b/home/.bash_aliases @@ -90,18 +90,20 @@ hash fzf 2>/dev/null && alias fzfp='fzf --preview '"'"'[[ $(file --mime {}) =~ b hash fzf 2>/dev/null && alias fzfph='fzf --height 60% --preview '"'"'[[ $(file --mime {}) =~ binary ]] && echo {} is a binary file || (bat --style=numbers --color=always {} || highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null | head -500'"'"'' alias g='git' alias gbl='git blame -wMC' +alias gcsc='auto_commit staged commit' alias gdf='git diff --name-only' alias gds='git diff --stat' alias getbase='cp -pv ~/code/codpro/base.c ~/code/codpro/base.cpp ./' alias gflff='git flow feature finish `git rev-parse --abbrev-ref HEAD | sed "s/feature\///"`' alias gflfs='git flow feature start' -alias glof='git log --pretty=fuller --stat --decorate --graph --show-signature' alias glm='git l --all' +alias glof='git log --pretty=fuller --stat --decorate --graph --show-signature' alias grepi='grep -i' +alias gsf='git show --pretty=fuller --show-signature' alias gtop='git rev-parse --show-toplevel' -alias gw='./gradlew ' alias gyolo='git yolo || git commit -m"$(curl -s whatthecommit.com/index.txt)"' #alias gwipit='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"' +#alias gw='./gradlew ' hash ipython3 2>/dev/null && alias ipy='ipython3' hash ipython2 2>/dev/null && alias ipy2='ipython2' diff --git a/scripts/bin/auto_commit b/scripts/bin/auto_commit index c9df6e2..d489287 100755 --- a/scripts/bin/auto_commit +++ b/scripts/bin/auto_commit @@ -34,7 +34,7 @@ fi if [ "$1" == "staged" ]; then DIFF=$(git diff --staged) elif [ "$1" == "show" ]; then - DIFF=$(git show HEAD) + DIFF=$(git show --pretty=fuller HEAD) elif [ "$1" == "diff-all" ]; then DIFF=$(git diff) elif [ "$1" == "diff-heads" ]; then