-
Notifications
You must be signed in to change notification settings - Fork 129
Allow '#' at the start of commit message #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…a space. In order to match #ID in the message.
The plugin offers out of the box a mechanism to parse commit messages for issue id references, which can configured with a custom regex (default is I'm going to close this for now, feel free to reopen should you find that the standard feature does not satisfy your requirement or if I misunderstood the problem. |
The regex in Source Control Integration is used to match issue id in the commit message. But if any line start with a '#' sign, Source HgWeb Integration will treat it as special case and did not add them into commit message. For example, in the original code, a HG commit message of
will cause Source HgWeb to get a commit message of only
The issue id is not treat as commit message and the regex in Source Control Integration cannot find it. Any line start with a '#' and is not followed by ' User', ' Date', ' Node', or ' Parent' will be ignore by the original code. I modified it to treat lines start with '#' but not followed by space as commit message, too. |
Sorry, I am not sure how to reopen this PR. I found this guide |
@Zipher04 I'm pretty sure most VCS ignore message lines beginning with a hash/pound/'#' symbol, so such a line is unlikely to even reach the SourceIntegration plugin intact. This is certainly the case with Subversion & Git. |
@Zipher04 thanks for the clarification.
gitbucket != github. Anyway, now that I understand what the problem is, I'll reopen the PR. @morgant I don't use Mercurial myself, but after a a quick test it appears there is no special handling for For the record, with Git it is possible to have lines starting with
|
@dregad Thanks for testing with mercurial, I should have checked before commenting! That's a good note about changing the comment character, does that mean we should not handle the comment lines at all (shouldn't the VCS have stripped them before they get to a SourceIntegration plugin anyway)? |
Heh 😉
AFAIK we currently don't have any special handling for comments, and I don't believe we should. In the Mercurial plugin's case, the lines beginning with Looking at Mercurial source, the raw changeset output is actually defined by a template. This means that a customized template might cause the plugin to break, but that's already the case today. Anyway, I believe we could be more specific in the plugin's code to parse only the headers defined in that template, and leave all the rest out to be treated as commit message text. |
Fixed in a0e9d0a |
Allow commit message to start a new line with # and not followed by a space.
In order to match #ID in the message.
For example, the following issue ID 58 can be matched now.