Created
February 9, 2020 03:27
-
-
Save tphummel/5c9517c028edf8a91245ba0658be9e8f to your computer and use it in GitHub Desktop.
convert master branch git log to csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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