this post was submitted on 20 Mar 2025
71 points (100.0% liked)

Programming

19223 readers
144 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 26 points 1 week ago (7 children)

I just keep my commit messages one-liners and elaborate more on pull requests, where there's enough context to really justify the change.

[–] [email protected] 16 points 1 week ago* (last edited 1 week ago) (6 children)

Putting the message in git puts the information closer to the code, since the pr isn't in git itself but instead the git forge. You can for example search the text of git messages from the git cli, or come across the explanation when doing git blame. I sometimes write verbose commit messages and then use them as the basis for the text in the pr, that way the reviewer can see it easily, but it's also available to anyone who might come across it when doing git archeology

[–] [email protected] 5 points 1 week ago (2 children)

Normally when I merge a PR I put the long PR message (if there is one) in the merge commit (again if there is one), rather than shitty Merge PR from patch1 that people seem to use.

You can actually change the behaviour on GitHub to be sane: https://blog.mergify.com/how-to-change-the-default-commit-message-on-github/amp/

If I'm not keeping the branch (usually PRs are not big enough to make preserving multiple commits useful) then I squash & merge which gives you the chance to edit the commit message and copy details from the PR message in.

[–] [email protected] 3 points 1 week ago* (last edited 1 week ago)

shitty Merge PR from patch1 that people seem to use

One of the reasons I hate merge commits and just force linear history on the repos I control.

[–] [email protected] 2 points 1 week ago

I hate the default merge commits. I got quite frustrated when a FOSS project rejected (or didn't come to a conclusion) my proposal for merge commits to also follow the commit formatting guidelines.

The cherry on top is merge commits describing which branch is being merged. But the branch disappears with that merge. I consider it worthless. The branch name is a name of the drafting process. There is no value to it when it lands.

load more comments (3 replies)
load more comments (3 replies)