Created
January 13, 2009 12:38
-
-
Save skmetz/46427 to your computer and use it in GitHub Desktop.
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
#!/bin/bash # test change | |
DATE=`date +%m-%e-%y` | |
OUTPUT="versions_as_of_$DATE.txt" | |
rm "$OUTPUT" | |
for d in `ls -d */` # get a list of all directories | |
do | |
DIR=${d/\//} # replace trailing / with nothing as in ${stringZ/replacethis/withthis} | |
GITDIR_ARG="--git-dir=$DIR/.git" | |
# Update my local copy with changes made in the remote. | |
# This will checkout any new changes to my working copy. | |
echo -e "\nPulling $DIR" | |
git "$GITDIR_ARG" pull | |
# Record the current checked out version. | |
echo "--------------------------------------------------------" >> "$OUTPUT" | |
echo "- $DIR " >> "$OUTPUT" | |
echo "--------------------------------------------------------" >> "$OUTPUT" | |
echo "--BRANCHES (current is marked with *)--" >> "$OUTPUT" | |
git "$GITDIR_ARG" branch >> "$OUTPUT" | |
echo "" >> "$OUTPUT" | |
echo "--DESCRIPTION (last tag, number of commits since tag, most recent commit OR--" >> "$OUTPUT" | |
echo "-- in some cases just most recent commit)--" >> "$OUTPUT" | |
git "$GITDIR_ARG" describe --long --always >> "$OUTPUT" | |
echo "" >> "$OUTPUT" | |
echo "--MOST RECENT COMMITs--" >> "$OUTPUT" | |
git "$GITDIR_ARG" log -n 3 >> "$OUTPUT" | |
echo "" >> "$OUTPUT" | |
echo "--ALL TAGS in this repository--" >> "$OUTPUT" | |
git "$GITDIR_ARG" tag >> "$OUTPUT" | |
echo -e "\n\n" >> "$OUTPUT" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment