Created
October 14, 2009 04:43
-
-
Save arnold-almeida/209795 to your computer and use it in GitHub Desktop.
GIT: Files changed since last tag
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 | |
unset GIT_DIR | |
cd /path/to/project | |
# Get our info.... | |
LATEST_TAG=$(git describe --tags --abbrev=0) | |
CURRENT_REVISION=$(git describe) | |
NUMBER_FILES_CHANGED=$(git diff --name-only HEAD $LATEST_TAG | wc -l) | |
#FILES_CHANGED=$(git diff --name-only HEAD $LATEST_TAG) | |
echo Current revision is at $CURRENT_REVISION for Tag: $LATEST_TAG | |
echo $NUMBER_FILES_CHANGED files have been changed | |
## Write this revision | |
echo "################################" > REVISION | |
echo "# $CURRENT_REVISION" >> REVISION | |
echo '# ' >> REVISION | |
echo "# $NUMBER_FILES_CHANGED files changed since last release $LATEST_TAG" >> REVISION | |
echo "################################" >> REVISION | |
echo ' ' >> REVISION | |
$(git diff --name-only HEAD $LATEST_TAG >> REVISION) | |
echo ' ' >> REVISION | |
## Append to revision history | |
cat REVISION >> REVISION.tmp | |
cat REVISION_HISTORY >> REVISION.tmp | |
mv REVISION.tmp REVISION_HISTORY | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this.