this post was submitted on 12 Dec 2023
810 points (99.0% liked)

Programmer Humor

19452 readers
116 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 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 36 points 10 months ago (2 children)
[–] [email protected] 13 points 10 months ago (1 children)
[–] [email protected] 39 points 10 months ago (2 children)

"patch mode" - Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history.

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

Highly recommend throwing --patch on any git commands you're used to using. You will have the prettiest, most atomic fkn commit, I'm serious people will love you for it.

I mean many people won't care, but the quality folk will notice and approve.

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

We make a singular commit per feature.

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

I always find this hard to follow personally.

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

Trunk based, eh? Yeah, we do that on a couple teams where I'm at, too. I like the philosophy, but force pushing the same commit over and over as you're incorporating review feedback is antisocial, especially when you've got devs trying to test your changes out on their machines.

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

eh, just squash and merge. Feature branch can be messy as long as main is clean

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

Yep. You have to make sure your feature branch works.

[–] [email protected] 4 points 10 months ago* (last edited 10 months ago) (1 children)

Or just use a good IDE that makes doing atomic commits pretty natural.

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

I've only tried the VS code hunk stager thing, and found it cumbersome compared to command line, but if you can make a GUI work for you ya go for it. I've never found it worth the trouble personally

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

Shout out to Lazygit for letting me stage individual lines

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

Looks pretty neat. I like that it shows the commands it's issuing!

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

You should try the JetBrains IDEs, as the other said, you can pick changes line by line graphically, when you commit, when you do a diff with another branch or when you fix conflicts. It's much more convenient than commands and terminal text editors.

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

Yay, learning!

[–] [email protected] 7 points 10 months ago* (last edited 10 months ago) (1 children)
[–] [email protected] 6 points 10 months ago

uuuuuuuu. and you could do -m to describe the commit.

next they'll add --push/-P.

perhaps add -r for fetch/rebase then commit.

one command to rule them all! 😈