diff --git a/aider/__init__.py b/aider/__init__.py index 2ee8a6499..b1dde9da7 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -2,11 +2,17 @@ __version__ = "0.54.8-dev" """ [[[cog -# TODO: write python to emit `git_hash = "X"`, where X is the latest 7-char git hash -# python goes here +import subprocess + +try: + git_hash = subprocess.check_output(['git', 'rev-parse', '--short=7', 'HEAD'], universal_newlines=True).strip() +except subprocess.CalledProcessError: + git_hash = "" + +print(f'git_hash = "{git_hash}"') ]]] """ -git_hash = "deadbee" +git_hash = "deadbee" # This line will be replaced by cog """ [[[end]]] """