summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-04-02 18:57:02 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-04-02 18:57:02 +0200
commitaa44d05ede5592a777c8ca097cc588efc4a7e9a0 (patch)
treef2f15769da5fad29fee4a5ae132df8233badda3f /src
parent3a351aa4368a57e3359eb99c8f506819816ad628 (diff)
add date information to git-blame
Diffstat (limited to 'src')
-rw-r--r--src/rc/git-tools.kak7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rc/git-tools.kak b/src/rc/git-tools.kak
index 7f244a66..1efc1775 100644
--- a/src/rc/git-tools.kak
+++ b/src/rc/git-tools.kak
@@ -31,10 +31,11 @@ def git-blame %{
setb git_blame_flags ''
%sh{ (
declare -A authors
+ declare -A dates
send_flags() {
if [[ -z "$line" ]]; then return; fi
- text="${sha:0:8} ${authors[$sha]}"
- flag="$line:black:$text"
+ text="${sha:0:8} ${dates[$sha]} ${authors[$sha]}"
+ flag="$line|black|$text"
for (( i=1; $i < $count; i++ )); do
flag="$flag;$(($line+$i))|black|$text"
done
@@ -48,6 +49,8 @@ def git-blame %{
count=${BASH_REMATCH[4]}
elif [[ $blame_line =~ author[^-](.*) ]]; then
authors[$sha]=${BASH_REMATCH[1]}
+ elif [[ $blame_line =~ author-time.([0-9]*) ]]; then
+ dates[$sha]="$(date -d @${BASH_REMATCH[1]} +'%F %T')"
fi
done; send_flags )
) >& /dev/null < /dev/null & }