From 4375964e19fc0c3cfe8e8433467881c6a40f2868 Mon Sep 17 00:00:00 2001 From: Nemo Date: Mon, 28 Jan 2019 13:01:23 +0530 Subject: [PATCH] steal from @harman28 --- files/bash/.bashrc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/files/bash/.bashrc b/files/bash/.bashrc index c3a53ab..33865d1 100644 --- a/files/bash/.bashrc +++ b/files/bash/.bashrc @@ -528,4 +528,22 @@ elif type compctl &>/dev/null; then } compctl -K _npm_completion npm fi -###-end-npm-completion-### \ No newline at end of file +###-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 +} \ No newline at end of file