Allow setting notes in commit_options from session data #1907
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1766
#commit_message
method to the more accurate#commit_options
(since it already returns author data in addition to the message):notes
key to the hash returned by#commit_options
, the value of which is sourced from the sessiongollum.notes
) can be set by a piece of middleware, analogous to the way this works for author infoPossible use cases are e.g. getting the client IP and using this info in the
:post_commit
Hook. In the future, we could provide a feature to actually store the contents of the:notes
field in a git note. For now, this only passes the info on to theCommitter
object. gollum/gollum-lib#431 ensures the note is stored in theCommitter
object, where it can be accessed from the Hook.