/
ilya.petrash
/
SimplePyScripts
Обзор
Документация
Войти
/
ilya.petrash
/
SimplePyScripts
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
gitpython_examples/print_lash_commit_hash.py
32 строки
612 B
gil9red
Refactoring. Using black code style
18 май 2023, 17:10
18 май 2023, 17:10
a215345
Код
Авторство
О чём код?
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" import subprocess def get_git_revision_hash() -> str: return ( subprocess .check_output(["git", "rev-parse", "HEAD"]) .strip() .decode("utf-8")) def get_git_revision_short_hash() -> str: return ( subprocess .check_output(["git", "rev-parse", "--short", "HEAD"]) .strip() .decode("utf-8") ) if __name__ == "__main__": print(get_git_revision_hash()) # c2d959d5e658ef2279e5e79ab21cf6e1f6a71597 print(get_git_revision_short_hash()) # c2d959d5