Repository: gohugoio/hugo (language: go)

Issue:
Full Commit Message in .GitInfo
**Current Behavior**

The `.GitInfo` object hat a `Subject` field which contains the first line of the commit message

**Proposed Bahavior**

Add another field `Message` with the full commit message.

**Reasoning**

We implemented a content management system based on Git and Hugo. For the meta information it would be useful to present the full commit message, e.g. as a tooltip on top of the subject.


Discussion / hints:
This would have to be added to this struct: https://github.com/bep/gitmap/blob/master/gitmap.go#L44

I'm not totally sure how that would work with the current `git log` approach.
@bep Thanks for the quick response and for providing this wonderful piece of software! This feature is not a blocker at all for us.

Fix patch:
diff --git a/docs/content/en/methods/page/GitInfo.md b/docs/content/en/methods/page/GitInfo.md
index 9dba2a2b20e..c54a77371e8 100644
--- a/docs/content/en/methods/page/GitInfo.md
+++ b/docs/content/en/methods/page/GitInfo.md
@@ -113,6 +113,16 @@ This is configurable. See&nbsp;[details].
 {{ end }}
 ```
 
+###### Body
+
+(`string`) The commit message body.
+
+```go-html-template
+{{ with .GitInfo }}
+  {{ .Body }} → - Two new pages added.
+{{ end }}
+```
+
 ## Last modified date
 
 By default, when `enableGitInfo` is `true`, the `Lastmod` method on a `Page` object returns the Git AuthorDate of the last commit that included the file.
diff --git a/go.mod b/go.mod
index 2cff6b5e079..8161c381344 100644
--- a/go.mod
+++ b/go.mod
@@ -8,7 +8,7 @@ require (
 	github.com/aws/aws-sdk-go-v2/service/cloudfront v1.35.4
 	github.com/bep/clocks v0.5.0
 	github.com/bep/debounce v1.2.0
-	github.com/bep/gitmap v1.1.2
+	github.com/bep/gitmap v1.4.0
 	github.com/bep/goat v0.5.0
 	github.com/bep/godartsass v1.2.0
 	github.com/bep/godartsass/v2 v2.0.0
diff --git a/go.sum b/go.sum
index 0498c7f8d05..94a38d9d48f 100644
--- a/go.sum
+++ b/go.sum
@@ -118,8 +118,8 @@ github.com/bep/clocks v0.5.0 h1:hhvKVGLPQWRVsBP/UB7ErrHYIO42gINVbvqxvYTPVps=
 github.com/bep/clocks v0.5.0/go.mod h1:SUq3q+OOq41y2lRQqH5fsOoxN8GbxSiT6jvoVVLCVhU=
 github.com/bep/debounce v1.2.0 h1:wXds8Kq8qRfwAOpAxHrJDbCXgC5aHSzgQb/0gKsHQqo=
 github.com/bep/debounce v1.2.0/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0=
-github.com/bep/gitmap v1.1.2 h1:zk04w1qc1COTZPPYWDQHvns3y1afOsdRfraFQ3qI840=
-github.com/bep/gitmap v1.1.2/go.mod h1:g9VRETxFUXNWzMiuxOwcudo6DfZkW9jOsOW0Ft4kYaY=
+github.com/bep/gitmap v1.4.0 h1:GeWbPb2QDTfcZLBQmCB693N3sJmPQfeu81fDrD5r8x8=
+github.com/bep/gitmap v1.4.0/go.mod h1:n+3W1f/rot2hynsqEGxGMErPRgT41n9CkGuzPvz9cIw=
 github.com/bep/goat v0.5.0 h1:S8jLXHCVy/EHIoCY+btKkmcxcXFd34a0Q63/0D4TKeA=
 github.com/bep/goat v0.5.0/go.mod h1:Md9x7gRxiWKs85yHlVTvHQw9rg86Bm+Y4SuYE8CTH7c=
 github.com/bep/godartsass v1.2.0 h1:E2VvQrxAHAFwbjyOIExAMmogTItSKodoKuijNrGm5yU=
diff --git a/source/fileInfo.go b/source/fileInfo.go
index efe88a2c11a..3a95a0593df 100644
--- a/source/fileInfo.go
+++ b/source/fileInfo.go
@@ -175,6 +175,8 @@ type GitInfo struct {
 	AuthorDate time.Time `json:"authorDate"`
 	// The commit date.
 	CommitDate time.Time `json:"commitDate"`
+	// The commit message's body.
+	Body string `json:"body"`
 }
 
 // IsZero returns true if the GitInfo is empty,


Test patch: