Skip to content

Instantly share code, notes, and snippets.

@KristianLyng
Created January 17, 2011 21:46
Show Gist options
  • Select an option

  • Save KristianLyng/783542 to your computer and use it in GitHub Desktop.

Select an option

Save KristianLyng/783542 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Author: Kristian Lyngstol <[email protected]>
#
# Generates RST for setting author, copyright, version.
echo ":Author: Tollef Fog Heen, Kristian Lyngstøl"
echo ":Copyright: Varnish Software AS 2010-2011, Redpill Linpro AS 2008-2009"
VER=`git tag -l --contains | sed s/version-//`
# Not a tagged commit. Should probably trigger big red letters.
if [ -z $VER ]; then
VER2="$(git tag -l | tail -n1)"
VER="untagged draft version $(git log --format='%h' | head -n1), following ${VER2}"
fi
echo ":Version: $VER"
echo -n ":Date: "
git log --format="%ad" --date=short | head -n1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment