mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-08 10:34:06 +00:00
20 lines
493 B
Python
Executable File
20 lines
493 B
Python
Executable File
#!/usr/bin/env python3
|
|
# Copyright (c) Jupyter Development Team.
|
|
# Distributed under the terms of the Modified BSD License.
|
|
from plumbum.cmd import git
|
|
|
|
|
|
class GitHelper:
|
|
@staticmethod
|
|
def commit_hash():
|
|
return git['rev-parse', 'HEAD']().strip()
|
|
|
|
@staticmethod
|
|
def commit_message():
|
|
return git["log", -1, "--pretty=%B"]().strip()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
print('Git hash:', GitHelper.commit_hash())
|
|
print('Git message:', GitHelper.commit_message())
|