Skip to content

Commit

Permalink
Add check-repo script.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfs committed Jul 3, 2012
1 parent 4ebf0f7 commit ac45ea3
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions check-repo
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

function print_usage
{
echo "Usage: $0 <DIRECTORY>"
echo "Check git repo located in <DIRECTORY> for new remote tags."
}

if [[ $# != 1 ]]
then
print_usage
exit 1
fi

cd $1

TAG_PRE=$( git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | tail -n 1)

git fetch --quiet

TAG_POST=$( git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | tail -n 1)

if [[ "$TAG_PRE" != "$TAG_POST" ]]; then
git show "$TAG_POST"
fi

0 comments on commit ac45ea3

Please sign in to comment.