Created
November 4, 2014 07:04
-
-
Save arnolddevos/59dc41c77c21e7083dd5 to your computer and use it in GitHub Desktop.
Scan git repos and produce a time-sorted, consolidated log. (Hint: edit the variables in this.)
This file contains hidden or 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
#! /bin/bash | |
# git-log-consolidate | |
set -e | |
SINCE="Aug 25" | |
UNTIL="Sep 19" | |
LOG=~/git-log-consolidated.log | |
TMP=$LOG.tmp | |
gather() { | |
set -e | |
XOX=$(basename $GIT_DIR) | |
if [ "$XOX" = ".git" ] | |
then XOX=$(basename $(dirname $GIT_DIR)) | |
fi | |
git log --format=format:"%ai [XOX] %s" --since="$SINCE" --until="$UNTIL" | sed -e"s/XOX/$XOX/" | |
} | |
PROJECTS="current" | |
echo -n > $TMP | |
export GIT_DIR | |
for root in $PROJECTS | |
do | |
for d in $(find ~/projects/$root -type d -name objects) | |
do | |
GIT_DIR=$(dirname $d) | |
if [ -e $GIT_DIR/index ] | |
then | |
echo $GIT_DIR | |
gather >> $TMP | |
echo >> $TMP | |
fi | |
done | |
done | |
sort -u < $TMP > $LOG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment