{% extends "repository/repository.html" %} {% block page_title %}Commit: {{ commit.id }}{% endblock %} {% block content %}
Author {{ commit.author }} {{ commit_time(commit.author.time, commit.author.offset) }}
Committer {{ commit.committer }} {{ commit_time(commit.committer.time, commit.committer.offset) }}
Commit ID {{ commit.id }}
Tree {{ commit.tree.id }}
Parent(s) {% for parent in commit.parents %} {{ parent.short_id }} {% endfor %}
± {{ diff.stats.files_changed }} files changed, {{ diff.stats.insertions }} insertions, {{ diff.stats.deletions }} deletions
{{ commit.message }}
{% for patch in diff %} {# The following status values are defined in the git_delta_t enum # in libgit2. See https://github.com/libgit2/libgit2/blob/main/include/git2/diff.h #} {# 1=ADDED (does not exist in old version) #} {# 2=DELETED (does not exist in new version) #} {# 3=MODIFIED (content changed between old and new versions) #} {# 4=RENAMED #} {# 5=COPIED #} {% if patch.delta.is_binary %} {% endif %} {% for hunk in patch.hunks if not patch.delta.is_binary %} {% for line in hunk.lines %} {% endfor %} {% endfor %}
-{{ patch.line_stats[2] }}/+{{ patch.line_stats[1] }} {% if patch.delta.status == 1 %} A {{ patch.delta.new_file.path }} {% endif %} {% if patch.delta.status == 2 %} D {{ patch.delta.old_file.path }} {% endif %} {% if patch.delta.status == 3 %} M {{ patch.delta.new_file.path }} {% endif %} {% if patch.delta.status == 4 %} R {{ patch.delta.old_file.path }} -> {{ patch.delta.new_file.path }} {% endif %} {% if patch.delta.status == 5 %} C {{ patch.delta.old_file.path }} {{ patch.delta.new_file.path }} {% endif %}
old size: {{ patch.delta.old_file.size|human_size(B=true) }} - new size: {{ patch.delta.new_file.size|human_size(B=true) }}
{% if patch.delta.status == 1 %} new file mode: {{ patch.delta.new_file.mode|filemode }} {% elif patch.delta.status == 2 %} deleted file mode: {{ patch.delta.old_file.mode|filemode }} {% elif patch.delta.old_file.mode != patch.delta.new_file.mode %} old mode: {{ patch.delta.old_file.mode|filemode }}
new mode: {{ patch.delta.new_file.mode|filemode }} {% endif %}
Binary file
{{ hunk.header }}
{% if line.old_lineno >= 0 %} {{ line.old_lineno }} {% endif %} {% if line.new_lineno >= 0 %} {{ line.new_lineno }} {% endif %} {{ line.origin }} {{ line.content }}
{% endfor %}
{% endblock %}