Skip to content

Instantly share code, notes, and snippets.

@juanpabloaj
Created March 20, 2012 16:14
Show Gist options
  • Save juanpabloaj/2137751 to your computer and use it in GitHub Desktop.
Save juanpabloaj/2137751 to your computer and use it in GitHub Desktop.
git: latest changes grouped by day
#!/bin/bash
a=""
b=""
for i in $(seq 0 10)
do
b=$(git diff --shortstat "@{ $i day ago }")
if [[ "$b" != "$a" ]]; then
echo $(date --date="$i days ago" +%F) $b
fi
a=$b
done
@juanpabloaj
Copy link
Author

output

1 day ago 2 files changed, 144 insertions(+), 21 deletions(-)
3 day ago 2 files changed, 227 insertions(+), 73 deletions(-)

@marko-lazic
Copy link

How this works? can i get results in days between? for example 1/1/2019 - 28/02/2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment