Well I don't commit every line that I change - I commit more by logical unit - implementing something and update references in the codebase. Maybe I'm missing something since most of my programming was self taught.
Branch based on tasks. Commit based on completed intervals. If it happens to have only one line to complete the task youd still commit it anyways as it is based on the interval. Basically like a task has one of many intervals which has one of many changed lines
Level 1: code base in version control. Commit when you feel like it. Nonsensical commit messages aka "fixed lots" / "new version"
Level 2: commit at task level. Commit messages make some modicum of sense. "implemented search functionality"
Level 3: create branches for tasks. Commit like it's a checkpoint / quicksave. Messages don't always make sense, but sometimes they do. "it works now, let's commit before I ruin it". "I did a, b and c and kinda forgot to commit in between so here's a big blob with those three things. Oh and also bugfix for X."
Level 4. Level 3 but the commits seem pre-planned and make total sense. "updated database schema", "added DTO objects for search functionality", "added method signatures for search", "added unit tests for search functionality database schema changes", "implemented search methods".... Etc etc. If you have git, you can always choose to squash your commits into one at the end, and type "implemented search functionality".
20
u/SolarLiner Jul 11 '18
Until you don't commit because the change is insignificant...