From ae9cf39a525e09077165a906c0d0a384d027dad9 Mon Sep 17 00:00:00 2001 From: Ian Moody Date: Mon, 11 Nov 2019 22:17:28 +0000 Subject: [PATCH] Include funcname in hunk header in commit view if available pygit2 unfortunately doesn't make the function name output directly available as a property on the hunk like it does for the line info, but we can extract it from the raw hunk header by splitting on the '@@'. The function name will be the last element and will be terminated by a '\n', so we strip that out. (If there is no function name the string will only be the '\n') --- gitsrht/templates/utils.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitsrht/templates/utils.html b/gitsrht/templates/utils.html index b3484e4..cc6a97c 100644 --- a/gitsrht/templates/utils.html +++ b/gitsrht/templates/utils.html @@ -159,7 +159,7 @@ endif %}{% endfor %} target="_blank" {% endif %} >{{hunk.new_start}},{{hunk.new_lines}} {# -#}@@ +#}@@{{hunk.header.split('@@')[-1][:-1]}} {% for line in hunk.lines %}