9 ms·
> Atomic commits can be great. I really prefer to see intentional atomic commits with meaningful messages than 20+ files changed with a commit message: "Feature
by tkiolp4 2y ago
> Atomic commits can be great. I really prefer to see intentional atomic commits with meaningful messages than 20+ files changed with a commit message: "Feature X".
The most valuable “feature” of git for me is the “single commit with 20+ files changes”. I explain: I have landed in a new codebase, and now I need to add a new feature that would include perhaps a migration and adding a “usecase” and perhaps a “controller” and the corresponding tests. As usual, things are never clear in new codebases (depending on the library/framework used, one might need to add routes to a main routing file, or perhaps touch some configuration yaml file to whitelist the newly introduced endpoint, or perhaps a changelog needs to be kept updated whenever a migration is introduced, etc.). My point is: if I can git blame a line of code of the codebase that’s doing already more or less what I want to introduce, I want to see ALL the files that were touched as part of that change. It’s a lifesaver.
- deleted 2y ago[deleted]
- mrinterweb 2y ago> How many years have you worked in the software industry? Professionally, 21 years. Seems like you're implying that someone with an opinion that is different than your own is not experienced.
- tkiolp4 2y agoI deleted that part because it sounded the wrong way (it wasn’t my intention to question your experience, but a genuine curiosity)
- mrinterweb 2y agoGit has great tools. It sounds like you'd want to see everything associated with a merge commit. If what you're looking for is a certain way to view changes, git's built in tooling usually has you covered regardless of commit strategy. So if you know a commit sha and you'd like to see all of the merged branch changes associated with that commit as a single patch, I cooked up a script that takes a commit sha and finds the merge commit and show all the changes in a consolidated patch. #!/bin/sh merge_commit=$(git log -n1 --merges --pretty=format:"%H" $(git rev-list --ancestry-path $1..HEAD --merges -n1)) git show -m -p --stat --format="" $merge_commit