this post was submitted on 01 Jan 2024
22 points (72.0% liked)

Programming

17303 readers
83 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 1 year ago
MODERATORS
top 8 comments
sorted by: hot top controversial new old
[–] [email protected] 22 points 10 months ago* (last edited 10 months ago) (1 children)

A title as uninformative as the single . commit messages he suggests writing.

Bare minimums of typo, refactor, whitespace, comments are barely any effort -- less than the thought it takes to name variables and functions.

I really can't agree with completely meaningless messages like minor and .

[–] technom 5 points 10 months ago

Git is a lot of things at once:

  1. A tool to record development history - warts and all
  2. A tool to create a logical sequence of changes
  3. A tool to communicate intent and ideas to a maintainer

Meaningless messages like minor and . don't suit any of these roles - not even 1. Even when recording development history with all mistakes, you'd still need context when you look back at the history. Matklad is a well respected developer. I wonder why he's make such a bizarre claim.

[–] dbx12 21 points 10 months ago (1 children)

Review is done before code gets into main, but that’s inefficient for most of the non-mission critical projects out there. A better approach is to optimistically merge most changes as soon as not-rocket-science allows it, and then later review the code in situ, in the main branch.

Assuming you have a project with continuous delivery, that is an absolute foot gun. Optimistically merge the change and then realize in situ that you forgot the WHERE part of your SQL command (or analog statement of the query builder)? No fucking thanks.

[–] xoggy 2 points 10 months ago* (last edited 10 months ago)

A better approach is to optimistically merge most changes as soon as not-rocket-science allows it, and then later review the code in situ, in the main branch.

I upvoted before reviewing the article in situ, then I had to go back and fix my upvote.

[–] snowe 5 points 10 months ago (2 children)

That’s why for typical project it is useful to merge pull requests into the main branch — the linear sequence of merge commits is a record of successful CI runs, and is a set of commits you want to git bisect over.

... if you do this you completely negate your ability to use git bisect...

[–] [email protected] 2 points 10 months ago (1 children)

Quite the opposite. If you fast forward merge without squashing, you lose the ability to meaningfully bisect, since only the head of each merge is checked by CI - other commits may not even build

[–] snowe 1 points 10 months ago

My point was about merging in general. Unless you’re either

  1. Making sure every single commit builds
  2. Squashing and merging, with no merge commit

Then you’re not going to be able to effectively use git bisect.

[–] [email protected] 1 points 10 months ago

Squash fast forward merge is the only way