I am working on a private installation of GitLab and I would like to know if there is a way to append automatically a string of text at the end of the comment when answering an issue (as, for example, a signature).
Thanks in advance for any help you are able to provide.
There's nothing in Gitlab that will let you automatically modify commit messages, or in Git to append to a message (that I know of), but you can prepend text to a commit message using a Git Hook. This can be useful for adding a branch name or User Story ID to a commit message.
Git Hooks are defined in the
.git/hooks
directory in your project. Thehooks
directory has some example files that show you how the different hooks can work. The examples in the fileprepare-commit-msg.sample
show a variety of ways to interact with a commit message, one of which is a way to add a "Signed off by John Doe" line to a commit message, which is similar to what you've asked for:If you uncomment that last bit, git will add the value of the
GIT_COMMITTER_IDENT
variable to the commit message withSigned-off-by Committer
.Note: it says that modifying the commit message is a bad idea in the example, but I'm unsure why. I edited your question to add the
git
tag, so hopefully someone else will know more about it than I do.