diff --git a/eris/tools.py b/eris/tools.py index 30a3194..8940956 100644 --- a/eris/tools.py +++ b/eris/tools.py @@ -399,6 +399,18 @@ def perltidy(path): return Status.normal, _syntax_highlight_using_path(stdout, path) +@deps(deps={"git"}, url="https://git-scm.com/docs/git-blame", + executables={"git"}) +def git_blame(path): + process = subprocess.run([ + "git", "blame", "--show-stats", "--date=short", "--color-lines", + "--color-by-age", path], text=True, capture_output=True) + status = (Status.normal if process.returncode == 0 + else Status.not_applicable) + return status, fill3.Fixed(termstr.TermStr.from_term( + process.stdout + process.stderr). splitlines()) + + @deps(deps={"git"}, url="https://git-scm.com/docs/git-log", executables={"git"}) def git_log(path): diff --git a/eris/tools.toml b/eris/tools.toml index fd14db5..952c86b 100644 --- a/eris/tools.toml +++ b/eris/tools.toml @@ -88,13 +88,6 @@ tools_for_extensions = [ command = "python3.7 -m dis" success_status = "normal" -[git_blame] - dependencies = ["git"] - url = "https://git-scm.com/docs/git-blame" - command = "git blame --show-stats --date=short" - success_status = "normal" - error_status = "not_applicable" - [objdump_headers] dependencies = ["binutils"] url = "https://en.wikipedia.org/wiki/Objdump"