mirror of
https://github.com/conventional-commits/conventionalcommits.org.git
synced 2026-03-23 06:01:43 -05:00
Confusion about the extent of feat #86
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CrispyDrone on GitHub (Oct 22, 2019).
Hello,
When I implement a new feature, it might be necessary or natural to also:
Currently the general trend is to squash merge features (#38) to have a clean commit history. However this means, that all of my carefully crafted intermediary commits with
chore,docs,style,refactor,... will go to waste.It also means that a single
featwill do more than just introduce a new feature, which is misleading.There was some nice discussion in issues #26 and #78 but it didn't settle this dilemma for me.
It seems to me that
feathas a broad definition:so maybe it isn't a problem to have
featbe an amalgamation of all kinds of commits? Or what is the official recommendation of the spec?@damianopetrungaro commented on GitHub (Oct 23, 2019):
You can still merge a PR with multiple commits (not squashed) in order to have all your commits in place right?
Am I missing something?
@CrispyDrone commented on GitHub (Oct 23, 2019):
Hi,
Thank you for your response.
I'm sorry my question wasn't that clear. It wasn't necessarily about having a pragmatic solution, there are different solutions out there.
My question is more about the extent of the
featcommit type according to the specification and what the specification seems to recommend i.e. separating commit types as much as possible.To me it seems that
featcan quite easily contain all kinds of other commit types; even though you update documentation, it's documentation for that feature, and it doesn't make much sense to separate it from the actual feature. Same for the refactoring, it is tightly connected to the feature. As a consequence of introducing a new feature that necessitated some refactoring, you might even fix a bug.What does the specification say about these scenarios, is it ok to just have the
featcommit introduce all these changes because in essence they are part of the package you call a new feature, or should we indeed keep them separate?@JeanMertz commented on GitHub (Oct 23, 2019):
To me
featrepresents something that adds "customer" value to your code, so even though you might also add documentation, do some refactor work, and add tests to validate a new feature, all of which are part of the bigger unit of "all things required to get this in a shippable state", those are not part of thefeatcommit(s).The GitHub PR (or whatever mechanism you are using) is which combines all these separate commits with their own problem domains into a single package signalling the intent that "this documentation commit, and these test commits go hand-in-hand with these feature commits".
The whole point of the convention described is precisely to split up these changes into smaller units, and create multiple commits where you would've written a single commit before including both the documentation, the tests and the feature.
It's good practice to commit your tests first anyway, as that allows you to get in the habit of test-driven design where you let the CI fail with your newly added tests, and then validate that those tests are green after pushing the
featcommit.Similarly, it makes sense (in my opinion) to write documentation first, to practice some form of "documentation driven design" to allow you to think up front about what you are going to build as you write out your thoughts in plain English.
But, some things work for some, but not for others, which is also why this is called a convention and not a set of hard rules you have to follow, see what works for you, but don't let your productivity be constrained by what the spec in this repository says, see if it helps you think differently about the way you code, and if that different way of coding does not suit you, look for some other best-practice that fits your style (or that of your company) better.
@CrispyDrone commented on GitHub (Oct 25, 2019):
Hello,
Thank you for your response.
It has helped clarify the intent of the
featcommit. I think that I will indeed have to reconsider the automatic squash based pull requests workflow, while also promoting the separation of commits as much as possible.