1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | import subprocess
from django.template import Library
register = Library()
try:
head = subprocess.Popen("git rev-parse --short HEAD",
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
VERSION = head.stdout.readline().strip()
except:
VERSION = u'unknown'
@register.simple_tag()
def git_short_version():
return VERSION
|
More like this
- Reshape list for table, flatten index in nested loops by aquagnu 5 years, 3 months ago
- Use git log to give your app a revision by peterbe 3 years, 6 months ago
- Text Highlighting Filter by girasquid 4 years, 5 months ago
- Digg-like pagination by SmileyChris 4 years ago
- Page numbers with ... like in Digg by Ciantic 4 years, 1 month ago
Comments