()
| 4 | import builtins |
| 5 | |
| 6 | def get_commit_hash(): |
| 7 | try: |
| 8 | file_path = pathlib.Path(__file__).parent |
| 9 | return subprocess.check_output( |
| 10 | [os.environ.get("GIT", "git"), "rev-parse", "HEAD"], |
| 11 | cwd=file_path, shell=False, stderr=subprocess.DEVNULL, encoding='utf8').strip()[0:8] |
| 12 | except Exception: |
| 13 | return "<none>" |
| 14 | |
| 15 | |
| 16 | REPOSITORY_NAME = "stable-diffusion-webui-depthmap-script" |