DEV Community

Discussion on: Do your commits pass this simple test?

 
stargator profile image
Stargator

I certainly don't recommend spending hours on a message. And in your example of the branch names containing the task number, we do that too.

But if branch 2345 is branched off of 1900, then some new commits are added to 1900. By looking at the commit history of 1900, how would you tell when 2345's commits ended and 1900's started?

Date, time, and author may be useful. But that would take more mental power than simply having "2345" at the start of all of 2345's commits and "1900" at the start of all of 1900's commits.

My team's backend branches off of each other quite a bit and sometimes the frontend team does it as well.

So those 2nd-tier branches depend on a 1st tier branch that isn't even completed. So the 1st tier branch could still change as time goes on, from new commits to changing the history of the branch.

That would cause conflicts to occur when the 2nd-tier branch tries to merge into master (after the 1st tier supposedly does) or when it rebases back onto the 1st tier branch.

It all just depends on the team's workflow, the team size, and the complexities of your tasks.

Ideally, nothing would get started that depends on changes that haven't been merged into master.

But in real-life messes happen, and having clear intent and purpose in the commit messages would be beneficial.

If you are spending hours on your commit message, maybe the work was too much for a single commit or you are overthinking the message.