Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Semantic commit type when remove something

What semantic commit type is better to use, when I remove a feature: feat, refactor or something else?

like image 944
Dmitry Druganov Avatar asked Jan 03 '18 10:01

Dmitry Druganov


People also ask

What is semantic commit?

Semantic Commits are commit messages with human and machine readable meaning, which follow particular conventions.

What is a breaking change commit?

BREAKING CHANGE: a commit that has a footer BREAKING CHANGE: , or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in Semantic Versioning). A BREAKING CHANGE can be part of commits of any type.

What is chore in commit?

ChoreCommit is a property of a chore that allows you to specify if the processes in a chore will be committed as a single transaction or if the processes in the chore are committed as multiple transactions. A Chore executes a sequence of TurboIntegrator processes as a single Commit transaction.


2 Answers

you should use refactor,

  • feat: introduces a new feature to the codebase
  • fix: patches a bug in your codebase
  • refactor: A code change that neither fixes a bug nor adds a feature

you can refer to angular/CONTRIBUTING Commit Message Guidelines

like image 179
jk2K Avatar answered Sep 19 '22 20:09

jk2K


By definition, it is refactor, since:

refactor: A code change that neither fixes a bug nor adds a feature

Removing a feature is certainly a code change, and it neither fixes a bug nor adds a feature.

However, people usually have an assumption that refactor tends to not introduce breaking changes. And removing a feature tends to always break the API, since a feature is removed from the API, and this breaks all existing system depending on that feature.

What about other types? Absence of a feature itself may be considered as a feature. For example, if someone dislike the idea of password login (it is annoying to input a password every time to login), then they may consider not having the feature of password login is a feature. Thus removing a feature can be considered as adding an new feature. At the same time, if absence of a feature itself may be considered as a feature, than the existence of that feature may be considered as a bug. So removing a feature may be considered as fixing a bug. Thus removing a feature is both feat and fix.

Alternatively, we can pretend that the problem does not exist. A well designed library should not have an unwanted feature. And since other libraries and applications may depend on this feature, so features should never be removed. But this ideal principle does not apply to every library.

So my suggestion is giving this type of commit a new name.

like image 23
weakish Avatar answered Sep 17 '22 20:09

weakish