by wantsanagent · 3y ago · 0 comments
In the workflow I was introduced to all commits backing a PR get squashed and merged with the commit message for that merge being the ticket number and title of the ticket the PR resolves.
This creates an incredibly clean commit history that is easy to trace back to tickets and their associated work items (like product docs). It also frees coders from any burden of writing good messages as they progress.
- It becomes harder to change the issue tracking software. I used to work for a company that went through a few bug trackers, resulting in tons of older commits referencing an inaccessible bug tracker.
- It forces developers to switch from their IDE or git blame to another tool when doing code archeology. The last thing I personally want when trying to understand some code is more context switch.
- Not all commits have an associated issue. I sometimes stumble upon problems in the code that I fix straight away. Writing a good commit message explaining the reason is important because otherwise the context is lost.
Ridiculous. That defeats the point of source control, which is partly to aid future readers, not merely track changes.
I’m happy your workflow works nicely for you, but I hope the mindset goes away.
Personally, I think it’s important to force push over your “bad commit” when it happens. That way you don’t generate dozens of WIP commits, and there’s no need to squash. But sometimes WIP commits are fine to let through. They inform other devs about what you’re experimenting with.
This approach when merging in the GH UI, puts the ticket number in the merged commit (not a merge commit though). And the biggest advantage of this approach is there is NEVER a "revert the revert" situation when dealing with reverting. So easy and clean to revert because you aren't reverting a merge commit.
I get that "we can't change issue tracking software" but that is just something you gotta live with, and the advantages of squash and merge far outweigh this "possibility".
You can still write “fix” and “wip” commits locally, as long as you rebase them before you push your branch.
You’re just saying that messages (or: what and why things happened to the code) should be moved out of the repository and into the issue tracker.
This is like me saying that wiki articles aren’t important… because we don’t use a wiki for documentation and just commit the docs in the repository. Yeah, sure. But most of your interlocutors were probably more concerned with the fact that things needed to be documented, somehow.