1
0
This commit is contained in:
Chicory ☕ 2024-07-13 17:52:11 +03:00
commit 28506bf4dd
Signed by: chicory
GPG Key ID: AC95A793F70BEDCD
2 changed files with 8 additions and 0 deletions

4
bash/.bashrc Normal file
View File

@ -0,0 +1,4 @@
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[31m\]\$(parse_git_branch)\[\033[00m\]$ "

4
bash/git-stat Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
git log --pretty=format:==%an --numstat | \
sed -r '/==.*/{s/^==//;h;D};/^$/D;s/-/0/g;s/\t[^\t]+$//;G;s/(.*)\n(.*)/\2\t\1/' \
| awk -F '\t' '{add[$1]+=$2;del[$1]+=$3} END {for (i in add) {print i,add[i],del[i]}}'