{{ define "_diff_type" }} {{ if .IsNew }}A {{ else if .IsDelete }}D {{ else }}M{{ end }} {{ end }} {{ define "repo_commit" }} {{ $commit := .P.Diff.Commit }} {{ $diff := .P.Diff.Diff }} {{ $stat := .P.Diff.Stat }} {{ $parents := .P.Diff.Parents }} {{ template "head" . }} {{ .RepoName }}: {{ $commit.HashShort }} {{ template "repo_header" . }}
{{ $stat.FilesChanged }} files changed, {{ $stat.Insertions }} insertions(+), {{ $stat.Deletions }} deletions(-)
            {{- if $commit.Message }}{{- $commit.Message -}}
            {{- else -}}Empty message{{- end -}}
          
Author: {{ $commit.AuthorName }} {{ $commit.AuthorEmail }}
{{ if ne $commit.AuthorEmail $commit.CommitterEmail }}
Committed by: {{ $commit.CommitterName }} {{ $commit.CommitterEmail }}
{{ end }}
Committed at: {{ humanizeTime $commit.Committed }}
{{ if $commit.ChangeID -}}
Change ID: {{ $commit.ChangeID }}
{{- end }} {{ if $parents }}
Parent: {{ range $i, $p := $parents -}} {{ if $i }}, {{ end -}} {{ $p }} {{- end }}
{{ end }}
{{ if gt (len $diff) 1 -}}
jump to {{ range $diff }} {{ $path := .Name.New }} {{ if not $path }}{{ $path = .Name.Old }}{{ end }} {{ end }}
{{ template "_diff_type" . }} {{ if .IsRename }}{{ .Name.Old }} → {{ .Name.New }} {{ else }}{{ $path }}{{ end }}
{{ end }}
{{ $this := $commit.Hash }} {{ $parent := "" }} {{ if $parents }}{{ $parent = index $parents 0 }}{{ end }} {{ range $diff }} {{ $path := .Name.New }} {{ if not $path }}{{ $path = .Name.Old }}{{ end }}
{{ template "_diff_type" . }} {{ if .IsNew }}{{ .Name.New }}{{ else }} {{ if $parent }}{{ .Name.New }} {{ else }}{{ .Name.Old }}{{ end }} {{ if .IsRename }}→{{ .Name.New }}{{ end }} {{ end }} {{ if .IsBinary }}

Not showing binary file.

{{ else }}
              {{- range .TextFragments -}}
              

{{- .Header -}}

{{- range .Lines -}} {{- if eq .Op.String "+" -}}{{ .String }} {{- else if eq .Op.String "-" -}}{{ .String }} {{- else -}}{{ .String }} {{- end -}} {{- end -}} {{- end -}}
{{ end }}
{{ end }}
{{ end }}