steal from @harman28

This commit is contained in:
Nemo 2019-01-28 13:01:23 +05:30
parent f0c461be13
commit 4375964e19
1 changed files with 19 additions and 1 deletions

View File

@ -528,4 +528,22 @@ elif type compctl &>/dev/null; then
}
compctl -K _npm_completion npm
fi
###-end-npm-completion-###
###-end-npm-completion-###
#
#
# Stolen from @ThatHarmanSingh
function sprint() {
# Set time format to unix so we can subtract
HISTTIMEFORMAT='%s ' history |
# History returns way more than needed
tail -n 4000 |
# Grep for git commits (after timestamps)
grep -E '^\d+\s+\d+\s+gc' |
# Max 15 days ago
awk -v now=$(date +%s) '(now - $2) < 15*24*60*60' |
# Cut out the timestamps for uniq check
cut -d ' ' -f 4- |
# To handle multiple commit-pull-reset-commit cycles
uniq
}