this post was submitted on 13 Nov 2024
29 points (100.0% liked)

Programming

17416 readers
52 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 !webdev@programming.dev



founded 1 year ago
MODERATORS
 

Git Commit Creation

This is an article in which I explore the details and thinking that goes into how you should create git commits, and why. I like to think of it as the article I wish existed when I was just starting out over 20 years ago.

I wanted to cover all the things that you should think about at a high level. That way it at least could work as an entry point to deeper exploration of the particular areas if the reader isn’t completely sold or they want to just gain a deeper understanding. While at the same time trying to provide enough details to show why and how these choices are valuable. This is always a tricky balance.

Anyways, I would love any feedback on thoughts on how this could be improved.

Thanks

top 3 comments
sorted by: hot top controversial new old
[–] GuilhermePelayo@slrpnk.net 5 points 2 days ago (1 children)

Good analysis, there are a few things that I think area bit opinionated and there is nothing wrong with that, I just don't agree with a few things out of context. For example I agree that code on main should be buildable and testable. Code in your own branch should be for yourself and should still have commits. Also lazygit really abstracts a huge chunk of git logic while making it easier to understand.

[–] leds@feddit.dk 2 points 2 days ago

Yeah a pull request should be formatted corectly, build, documented, pass all tests and have changes covered in tests.

Your own branch? Do whatever you want, will get squashed anyway in the pull request.

[–] sorter_plainview@lemmy.today 3 points 2 days ago

So this bit confuses me. The article says in the intent and scope section that the entire process of bug fixing, in the included example, is literal bug fixing, clean up toggle, correct lints, correct duplication. That point to linting issues.

The earlier section says that a commit should be 'buildable' and 'testable'. So if there are linting issues, the commit won't satisfy this criteria right?

What am I missing here?