this post was submitted on 04 Apr 2024
1096 points (98.2% liked)

Programmer Humor

19910 readers
2275 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

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

Squash and rebase or squash or rebase?

[–] [email protected] 5 points 9 months ago (1 children)

..and? You squash so all your gross "isort" "forgot to commit this file" "WIP but I'm getting lunch" commits can be cleaned up into a single "Add endpoint to allow users to set their blah blah" comment with a nice extended description.

You then rebase so you have a nice linear history with no weird merge commits hanging around.

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

You squash so all your gross "isort" "forgot to commit this file" "WIP but I'm getting lunch" commits can be cleaned up

The next step on the Git-journey is to use interactive rebasing in order to never push these commits in the first place and maintain a clean history to be consumed by the code reviewer.

Squashing is still nice in order to have a one-to-one relationship between commits on the main branch to pull requests merged, imo.