{{$index := 0}}
<div class="timeline-item commits-list">
{{range .comment.Commits}}
	{{$tag := printf "%s-%d" $.comment.HashTag $index}}
	{{$index = Eval $index "+" 1}}
	<div class="singular-commit" id="{{$tag}}">
		<span class="badge badge-commit">{{svg "octicon-git-commit"}}</span>
		{{if .User}}
			<a class="avatar" href="{{.User.HomeLink}}">{{ctx.AvatarUtils.Avatar .User 20}}</a>
		{{else}}
			{{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 20}}
		{{end}}

		{{$commitLink := printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}}

		{{/* Only link those commits in the file diff view that can actually be reviewed there.
					A force push or other rewriting of history will cause a commit to not be
					part of the pull request anymore. */}}
		{{if index $.root.CommitIDs .ID.String}}
			{{$commitLink = printf "%s/pulls/%d/commits/%s" $.comment.Issue.PullRequest.BaseRepo.Link $.comment.Issue.Index (PathEscape .ID.String)}}
		{{end}}

		<span class="tw-flex-1 tw-font-mono gt-ellipsis" title="{{.Summary}}">
			{{- RenderCommitMessageLinkSubject $.root.Context .Message $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}}
		</span>

		{{if IsMultilineCommitMessage .Message}}
			<button class="ui button ellipsis-button show-panel toggle" data-panel="[data-singular-commit-body-for='{{$tag}}']">...</button>
		{{end}}

		<span class="shabox tw-flex tw-items-center tw-gap-2">
			{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}
			{{template "repo/shabox" (dict
				"sha1" .ID.String
				"commitLink" $commitLink
				"signature" .Signature
				"verification" .Verification
			)}}
		</span>
	</div>
	{{if IsMultilineCommitMessage .Message}}
	<pre class="commit-body tw-ml-[33px] tw-hidden" data-singular-commit-body-for="{{$tag}}">
		{{- RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}}
	</pre>
	{{end}}
{{end}}
</div>
