-
Notifications
You must be signed in to change notification settings - Fork 10
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
- fixes #24: allow custom sections #39
Conversation
Rebased to develop. |
Still need to update the README |
README updated |
Thanks for the PR. That’s a cool addition 👍 I left some comments at line numbers. See above. Next thing I’m going to do ist checkout your changes on my local machine … |
Updated README and included usage example As for the Your example commit message has the keyword closes along with the issue id on one line. Would you want to include all of the other information in the change log as well? |
Not, not personally. But it would be possible with the |
Question: I don’t see the need of |
Removed |
Oops. My line comments are gone with your commit 😆 |
Yes Gruntfile.js@11: /*
changelog.js@49 Bad idea to get rid of the m option! See also also changes of: README.md |
I have added the comment to Gruntfile.js As for the |
As for the |
As for the But I guess that keeping the /gim options for the original regexes would be a wise move in conjunction with --pretty=%s. This would require two different code paths though, one for use with custom sections and a second for reproducing the old behaviour, which is actually lost with this patch when going against a git repository. In my world, though, commit messages are made up of lines with those to keep prefixed by a
|
Using Example commit message:
Will be become the following lines within the changelog:
Which looks like three different commits. You could reproduce that with the following settings within the grunt file
But that seems to be already »broken«, before your PR 😯 |
Thanks for your effort with this nice addition 😍 @ericmatthys Do you like to review this before I merge it into the develop branch? |
@mischah @ericmatthys Since this breaks existing behaviour with the --pretty=%s when getting the log from git, I would refrain from merging this at this stage. I am currently looking into xregexp, if you do not mind adding another dependency, and joining all regular expressions, making them named groups and using the flags The named groups can in turn be used by the user in his or her section regexes, and will also be passed along with the data to the template in order for the user to define the templates in a more flexible way. |
@mischah @ericmatthys xregexp is rather problematic and leads to a lot of unwanted infinite loops, besides of that it comes short when using equally named sub groups. dropping this approach. Need to give up on this one, although I hate it. As of %s this will only fail with my commit messages, thanks to logArguments this is now leveraged and I think that this can be safely merged. 👍 |
@mischah If you add comments through the Files tab instead of directly on the commit, the PR will still show your comments even if the commit it was attached to is force pushed out of existence. It seems like multiline commit messages and custom sections are two different topics, which we don't want to conflate in this PR. I'd rather see custom sections implemented as close to the existing uses of regex / log parsing first, and then look at changing that behavior separately if we need to. |
Current state of affairs:
I will revert these changes and make this match the original behaviour. |
@mischah @ericmatthys I have revised the PR and reverted getChanges to its original behaviour, no longer line matching. I had to give up on my fallback 'others' section regexp, though, as it will now duplicate existing entries. I need to figure this out, perhaps a multi-line option would do the trick, shifting existing parsing from global to single line... |
Rebased to master |
Collapsed existing commits into one. |
Rebased to develop |
Updated readme and collapsed commits. |
@mischah Perhaps you might want to have a look at this? |
Closing since I no longer have need for this. |
I have recreated the patch based on the new develop branch and fixed all test cases. I also included a new test case for the custom sections feature.