Hacker News new | ask | show | jobs
by wantsanagent 1305 days ago
Variation on 2 - We don't care about commit messages at all. All PRs must have good descriptions which use a company-wide template. But individual commits get squashed and their commit messages entirely replaced by the PR template contents.

So my commit history is

"fump" "GAH" "I think this works?"

etc. but all changes have a description of the issue (and link back to the ticket) the solution described in some detail.

1 comments

Is there any tooling you use to squash the commits and use the PR message?
Github has a "squash and merge" option during merging. You can disable the other options (merge, rebase) in the repo settings.

I've worked with squash and merge almost everywhere and it's great. Keeps history clean (1 commit = 1 ticket, usually), and links back to the PR with discussions and context.

Unless your tickets are tiny, the single commit will have multiple functional changes and be harder to rollback.

I squash my commits into functionally independent units so they make sense and can be rolled back easily. Rebase FTW.

A sibling comment mentioned GitHub, I'll also add GitLab here as well, which allows you to do the same thing in their merge requests (the equivalent of pull requests).

Just checked, it doesn't seem that my self-hosted Gitea instance allows for that, so neither does Gogs (or maybe I just can't find the option in the UI).