Skip to content

Instantly share code, notes, and snippets.

@tphummel
Created February 9, 2020 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tphummel/5c9517c028edf8a91245ba0658be9e8f to your computer and use it in GitHub Desktop.
Save tphummel/5c9517c028edf8a91245ba0658be9e8f to your computer and use it in GitHub Desktop.
convert master branch git log to csv
#!/usr/bin/env bash
set -o nounset
set -o errexit
set -o pipefail
set -x
IFS=$'\n\t'
main(){
for d in *; do
if [ -d "$d" ]; then
pushd "$d" # or: if test -d "$d"; then
pwd
if [ -d ./.git ]; then
git log --pretty=format:'%h;%an;%ad;%s' > ./log.csv
local repo=${PWD##*/}
awk -v repo="$repo" '{print repo ";" $0}' ./log.csv >> ../merged-git-log.csv
rm -f ./log.csv
fi
popd
pwd
fi
done
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment