Skip to content

Commit

Permalink
Merge pull request #420 from dwhswenson/git_HEAD
Browse files Browse the repository at this point in the history
Getting the actual git hash for editable installs
  • Loading branch information
jhprinz committed Jan 19, 2016
2 parents 57edc4b + 590fa22 commit 1e7b19b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions openpathsampling/__init__.py
Expand Up @@ -98,3 +98,10 @@
)

from storage.storage import Storage, AnalysisStorage

def git_HEAD():
from subprocess import check_output
import os.path
git_dir = os.path.dirname(os.path.realpath(__file__))
return check_output(["git", "-C", git_dir, "rev-parse", "HEAD"])[:-1]
# chops the newline at the end

0 comments on commit 1e7b19b

Please sign in to comment.