3 ms·
One thing you lose is history across filename changes. Git can track renaming, but if in the same commit you also change the contents of the file, git has no wa
by mcv 11y ago
One thing you lose is history across filename changes. Git can track renaming, but if in the same commit you also change the contents of the file, git has no way to figure that out. Separate it over two changes, and git knows what happened.
For that reason I also try to spread big refactorings over a couple of commits (always with the code working after each commit, of course).
I also like to have formatting changes in a separate commit. Mixing functional changes with formatting changes means every line in the file has changed, and the functional changes become invisible. (Though commit hooks that demand an (Jira) issue nr in the commit message make this hard.)
- mbrock 11y agoIsn't this mostly true if you both change the file name and change most of the file's content? In which case it might be best to just see it as a deletion and creation anyway?
- mcv 11y agoIf the file still serves roughly the same functionality, just is refactored form, I think it's nice if the old version still shows up in the history.