this post was submitted on 01 Feb 2024
54 points (93.5% liked)
Git
2541 readers
10 users here now
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Resources
Rules
- Follow programming.dev rules
- Be excellent to each other, no hostility towards users for any reason
- No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.
Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Meh. I'd argue that info should be in a merge request, than in a commit comment.
Not certain how this organization does it, but a branch contain all the backstory and context. Commits are labels inside a branch, of which there can be many.
Well, there's different workflows. Big organizations tend to meticulously craft these branches and then do a big bang merge at the end.
But for smaller organizations/teams, it's usually more useful to merge as early as possible, i.e. work directly on a single branch together. This avoids complex merge conflicts and allows others to benefit from your work as early as possible.
In particular, smaller teams tend to also go together with smaller projects, where many features may be completed in a single commit, so there's not much of a backstory to tell...
The proper way to organize a branch is as a logical sequence of sub-features - each represented by a commit. Ideally, the commits should not break the build while introducing its feature. In many such cases, each commit may have a back story - the tests you did, your decision process, online references (that apply only to that commit - something like stackoverflow answers), etc.
Branch messages don't have the fidelity to capture such information. You may question the need for such detailed info. However, along with git blame and bisect, those commit messages are invaluable. I have lost count of how many times my own detailed commit messages helped me. And while I don't usually look at others' commits in such detail, I do read the details of commits that I'm interested in.
Git (and other VCSs) isn't just a snapshot tool. It's a history tool with the ability to capture history documentation. Honestly, Git is extremely underutilized in that capacity.