-
Notifications
You must be signed in to change notification settings - Fork 139
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
Multi line event split #30
base: master
Are you sure you want to change the base?
Conversation
May I ask you for a complete example of the content of a commit message containing 2 "events" with a body ?. If you have some corner cases (no body in one or the other commit.), please include them also. Depending on that I'll take the inclusion decision. At first glance in your code, it seem that you do not allow to have a body for your inner In general these are my reflection on this topic:
I've read your code and here are some further remarks (any modification of your code can wait until I make myself clear about an inclusion). So these are more general remarks as much for myself than for your curiosity about python:
Many thanks for your interest and your proposal. |
8a2f259
to
d40870f
Compare
Hi Vaab, Thank you for looking at my suggested modifications. I have made the changes you suggested (more for my own sake than for yours) and it is a great improvement. To answer your request for a complete example of the content of a commit message containing 2 "events" with a body, I do not have such a commit! All the commits I tested it on are multiple lines of subject with no body. With this in mind I would like to add a new section "Notes" to the output which contains numbered entries (the body of the commit message) referenced by the entries split from the subject. Clearly, this would be more complex as if only a single "event" is present in the subject this is not needed and the body could just be quoted as before. I have now changed my code to simply throw away the body when using a split_event_regex. Sadly my ideal is probably beyond my current level of Python-fu! I would need to cull any ignored events and then, if there was still more than one add a note with multiple references or if there is only one use the previous behaviour. To back up my idea it is exactly the situation where one has two commit message in one when having to speak to two different audience which prompted my modifications. Also with regard to the code - it now passes the integration tests! I have changed the default behaviour back to the original default behaviour by setting the default value for split_event_regex to None and removing the erroneous default (which I used when testing). I have also fixed the regex to properly split on entries (it needed to match the : too!). Thanks for your interest in my proposal - and the free Python class! :-) |
1 similar comment
1 similar comment
What do you think if we allowed the full commit message to be splitted upon a newline, followed by a new summary ? This would allow this type of commit message::
Or even (first without body):
Or even (second without body):
Or several with only their summary::
Tags, and all the other mecanism would apply. This doesn't seem to be very difficult to implement, and could leverage your By the way, I think "entry" is much better than "event", as we are speaking of logs, and that seems to be the consecrated vocabulary. Please, feel free to share your thoughts about these suggestions... |
Thanks for your feedback. Firstly, I chose the name event instead of entry because each git log entry is already referred to as an entry (obviously) and we are talking about multiple events logged as a single entry. I was trying to avoid the confusion of referring to multiple entries encapsulated in a single entry. Of course, it is your project so you should have final say on this. Secondly, I would still like to implement two subjects with one body (as our company git policy would not allow for commits with subjects that would not show up in a summary). I give an example below.
This would allow for four possible types of event/entry, and presumably any combination thereof:
With regards to the note in the above example it could be displayed as per the existing code when referenced from a single event and as a numbered note when referenced from multiple (post filtering) events. |
Ok, I understand your point for the terminology choice between "entry" and "event". It seems that your way of separating events in a commit message is rather local to your company's requirement. There a several point where the format chosen is bad in a general point of view as it goes against standards (one line summary then new line), and is quite limited compared to a the other proposed choice. However, I understand that this is your need, and this might be a good reason to have an option in the configuration file that allow to separate a commit message to commit event. This options should be callable taking the full commit message and outputing multiple sub commit messages. This would allow a direct function to be used, but we could of course try to simpilfy the writing of this like it was done for |
to being processed allowing for multiple "events" to occur in a single commit. When this feature is used the commit subject and body are combined prior to splitting.
now named split_event_regex and defaults to None leaving default behaviour as upstream.
a3482a4
to
9f8b2ee
Compare
ce9843a
to
7c6b7f1
Compare
fedee4e
to
b1cb854
Compare
b8bd6c6
to
f53d1cc
Compare
I also would like a split functionality like this. I wonder what is left to make this in a mergeable state. |
Hi,
I think it would be useful if gitchangelog were able to process multiple events from the same commit, like the example below...
new: Added a feature
fix: Fixed a bug
...should result in two entries to the changelog, one for the new feature and one for the bug fix.
The code I have added achieves this, although I am sure you could have done a much better job!
Basic documentation has been added to gitchangelog.rc.reference.
I would be interested to hear your views - please be kind about my Python, I'm a C++ dev at heart!
Thanks.