|
|
|
|
|
by lysp
1682 days ago
|
|
That's why I prefer feature branches with merge commits. Your dev branch is clean because each merge-commit is a single commit per task. So you can see which tasks were merged and in which order and what file as a whole were changed in each task. If for debugging / code review or any other reason need to look at specifics, you can look through the feature branch commit by commit to see what was changed and why. It's best of both worlds. Similarly merging dev into master/main. You get a release by release view of what files were changed in a single merge commit. |
|
Following the rules described above means that you get a lot of context on why code was changed:
* the invidivual commit which should contain a description of the change if the change is not self explanatory or not 'intuitive', the individual commit should consist of only 1 functional change
* the commits surrounding it, the feature branch (clearly visible because of the merge commits)
* the issue number on the commit itself and possibly in the merge commit
I've found all this context very informative for projects that are in maintenance mode and still need changes from time to time. Obviously, the higher the quality of the commit history, the higher the quality of the information you get out of it.
Meaning: if you put a rename with an impact over the whole code base (because the original name just happened to bother you that day) together with a bugfix in the same commit and the commit message has the very informative text 'fix', and the referenced issue mentions 'add support for blah' (but the commit obviously does not implement anything related to 'blah'), then... well, yeah, then how you organise your commit history does not really matter.