jenkinsci / scm-sync-configuration-plugin

Jenkins scm-sync-configuration plugin
https://plugins.jenkins.io/scm-sync-configuration/
MIT License
115 stars 123 forks source link

update to the commit message pattern #6

Closed tjaartvdwalt closed 9 years ago

tjaartvdwalt commented 12 years ago

At our company we have a scm pre-commit hook that expects commit messages in the following pattern: bug# - commit message

With the current implementation there is no way to have only your commit message used without extra text. e.g: "Modification on file with following comment : MY COMMENT" instead of simply "MY COMMENT"

I have added a [comment] pattern, that will get replaced with the exact text from your comment.

buildhive commented 12 years ago

Jenkins » scm-sync-configuration-plugin #13 SUCCESS This pull request looks good (what's this?)

fcamblor commented 12 years ago

Hi,

I agree with your pull request, but doing like you did, you will lose the "who made the modification" (which is logged in commit message when things are done by a human). Moreover, you will lose some useful informations like a job renamed for instance (which is present in the left part of the message). Are you conscious about these information loss ? Maybe should we be more explicit in online help information about the pattern ?

Maybe should we rather split pattern into something like this : [technicalMessage] : [commitMessage] (if we do such a refactoring, we will have to migrate existing data to transform "[message]" string in scm sync config persisted pattern into "[technicalMessage] : [commitMessage]")

WDYT ?

buildhive commented 12 years ago

Jenkins » scm-sync-configuration-plugin #14 SUCCESS This pull request looks good (what's this?)

tjaartvdwalt commented 12 years ago

Hi Frédéric,

I am new to the project, so I did not realise about the information loss.

I have created more fine grained patterns so that you have the ability to build your own custom message i.e [message] = [technicalMessage] by [user] with following comment: [commitMessage]

fcamblor commented 12 years ago

Yup I thought about this way of implementing things when I implemented first the commit message pattern.

Problem is you're misleading the user : if he transforms the pattern to "[technicalMessage] par [user] avec le commentaire suivant : [commitMessage]" (translation in french ;)) it won't reflect the reality (because the "by" and "with following comment" are both optional and hardcoded)

I would rollback your last commit and prefer just using special [technicalMessage] and [commitMessage]. [technicalMessage](maybe badly named) would represent a message technically generated by the plugin, allowing to provide some context to the commit (maybe should we rename it "[contextMessage]". End user won't have the possibility to customize this message. He will only be able to customize if he want it to be displayed (and where) or not. [commitMessage] would represent the message entered by the user (maybe should we rename it "[userMessage]")

jenkinsadmin commented 11 years ago

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

tjaartvdwalt commented 9 years ago

this request is very old, and I do not use the plugin anymore.