diff --git a/utils/git_log.py b/utils/git_log.py index bbef40febc1f8d30e64b4ea7744dc3f15e42900f..2945a587e1f050cc89659d1b768d4440a105190d 100644 --- a/utils/git_log.py +++ b/utils/git_log.py @@ -77,6 +77,22 @@ class GitCommit: ) return p.stdout.read() + @property + def sha1_short(self): + cmd = ( + "git", + "--git-dir", + self._git_dir, + "rev-parse", + "--short", + self.sha1, + ) + p = subprocess.Popen( + cmd, + stdout=subprocess.PIPE, + ) + return p.stdout.read().strip().decode('ascii') + @property def author(self): ret = self._author