Skip to content

Instantly share code, notes, and snippets.

@TurRil
Created September 8, 2023 09:16
Show Gist options
  • Save TurRil/33863755b810bac3504ff85212592b16 to your computer and use it in GitHub Desktop.
Save TurRil/33863755b810bac3504ff85212592b16 to your computer and use it in GitHub Desktop.
Github log pretty print with stats and formatting
# --since='last month'
echo "commit id|author|date|comment|changed files|lines added|lines deleted" > github_log.csv
git log --after='2022-1-1' --date=local --all --pretty=format:'@%h|%an|%ad|%s|' --shortstat --no-merges | tr "\n" " " | tr "@" "\n" >> github_log.csv
sed -i 's/ files changed,/|/g' github_log.csv
sed -i 's/ file changed,/|/g' github_log.csv
sed -i 's/ insertions(+),/|/g' github_log.csv
sed -i 's/ insertion(+),/|/g' github_log.csv
sed -i 's/ insertions(+)/|0/g' github_log.csv
sed -i 's/ insertion(+)/|0/g' github_log.csv
sed -i 's/ deletions(-)//g' github_log.csv
sed -i 's/ deletion(-)//g' github_log.csv
sed -i 's/|\s\s\s/|/g' github_log.csv
sed -i 's/|\s\s/|/g' github_log.csv
sed -i 's/|\s/|/g' github_log.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment