{{ 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 }}
Committed at: {{ $commit.Committed }}
{{ if $commit.ChangeID -}}
Change ID: {{ $commit.ChangeID }}
{{- end }}
Parent: {{ range $i, $p := $parents -}} {{ if $i }}, {{ end -}} {{ $p }} {{- end }}
{{ if gt (len $diff) 1 -}}
jump to {{ range $diff }} {{ $path := .Name.New }} {{ if not $path }}{{ $path = .Name.Old }}{{ end }} {{ end }}
{{ if .IsNew }}A{{ end }} {{ if .IsDelete }}D{{ end }} {{ if not (or .IsNew .IsDelete) }}M{{ end }} {{ if and .Name.Old .Name.New }}{{ .Name.Old }} → {{ .Name.New }}{{ else }}{{ $path }}{{ end }}
{{ end }}
{{ $this := $commit.Hash }} {{ $parent := index $parents 0 }} {{ range $diff }} {{ $path := .Name.New }} {{ if not $path }}{{ $path = .Name.Old }}{{ end }}
{{ if .IsNew }} A {{ end }} {{ if .IsDelete }} D {{ end }} {{ if not (or .IsNew .IsDelete) }} M {{ end }} {{ if .Name.Old }} {{ .Name.Old }} {{ if .Name.New }} → {{ .Name.New }} {{ end }} {{ else }} {{ .Name.New }} {{- end -}} {{ if .IsBinary }}

Not showing binary file.

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

{{- .Header -}}

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