1 2 3 4 5 6 7 8 | import subprocess
_proc = subprocess.Popen('git log --no-color -n 1 --date=iso',
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
try:
GIT_REVISION_DATE = [x.split('Date:')[1].split('+')[0].strip() for x in
_proc.communicate()[0].splitlines() if x.startswith('Date:')][0]
except IndexError:
GIT_REVISION_DATE = 'unknown'
|
More like this
- really spaceless (trim spaces at line start) by wolfram 4 years ago
- Git media cache busting tag by adamlofts 2 years, 2 months ago
- Digg-like pagination by SmileyChris 2 years, 8 months ago
- All Imports Checker by madhav.bnk 2 years, 2 months ago
- Yet another SQL debugging facility by miracle2k 4 years, 5 months ago
Comments
Is it only for Linux machines? Thanks...
#
Nice and simple idea. Since I prefer mercurial a slight modification will be needed though.
Thanks.
#