GitInfo doesn't seem to be set when a page has exactly 1 commit. I have a partial with this (simplified) code:
{{- $recent := where .Site.RegularPages.ByLastmod.Reverse "Type" "eq" "notes" }}
{{- $recent_num := (.Site.Params.widgets.recent_num | default 10) }}
{{- if $recent }}
{{- range first $recent_num $recent }}
{{- if ne .Title "" }}
{{ .GitInfo }}
{{ $lastmod := .Lastmod.Format "Jan 2, 2006" }}
- {{ .Title }}
{{ $lastmod }}
{{- end }}
{{- end }}
{{- end }}
Which prints this:

The file has exactly 1 commit:

All the other files have more than 1 commit. From Hugo's Lastmod and GitInfo doc pages I expect that pages with exactly 1 commit have GitInfo populated like pages with more than 1 commit.
My config.toml [frontmatter] config looks like this:
[frontmatter] date = ["date", "publishDate", "lastmod"] lastmod = ["lastmod", ":git", "date", "publishDate"] publishDate = ["publishDate", "date"]
What version of Hugo are you using (hugo version)?
hugo v0.97.3-078053a43d746a26aa3d48cf1ec7122ae78a9bb4 darwin/amd64 BuildDate=2022-04-18T17:22:19Z VendorInfo=gohugoio
Does this issue reproduce with the latest release?
Yes
GitInfo doesn't seem to be set when a page has exactly 1 commit. I have a partial with this (simplified) code:
{{- $recent := where .Site.RegularPages.ByLastmod.Reverse "Type" "eq" "notes" }}
{{- $recent_num := (.Site.Params.widgets.recent_num | default 10) }}
{{- if $recent }}
{{- range first $recent_num $recent }} {{- if ne .Title "" }} {{ .GitInfo }} {{ $lastmod := .Lastmod.Format "Jan 2, 2006" }}- {{ .Title }}
{{- end }}
{{- end }}
{{- end }}{{ $lastmod }}
Which prints this:
The file has exactly 1 commit:
All the other files have more than 1 commit. From Hugo's Lastmod and GitInfo doc pages I expect that pages with exactly 1 commit have GitInfo populated like pages with more than 1 commit.
My config.toml [frontmatter] config looks like this:
[frontmatter] date = ["date", "publishDate", "lastmod"] lastmod = ["lastmod", ":git", "date", "publishDate"] publishDate = ["publishDate", "date"]What version of Hugo are you using (
hugo version)?hugo v0.97.3-078053a43d746a26aa3d48cf1ec7122ae78a9bb4 darwin/amd64 BuildDate=2022-04-18T17:22:19Z VendorInfo=gohugoio
Does this issue reproduce with the latest release?
Yes