Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yup, but you need to reference the commit ID, meaning that you always need to create two commits, one for the reformatting, and a second one for updating the .git-blame-ignore-revs file. Additionally, you may not use git rebase, or any other workflow that modifies the history, or the references will be broken. Third, the git config needs to be set per-project (can't be set globally), so all developers need to manually adjust their config, for this feature to be useful.

If you value a clean commit history, then simply reformat as part of the code change. With autoformatting on save (e.g. through prettier), that's a complete non-issue anyways.



Until you change the formatting rules and the whole codebase is in one diff. This seems to happen at least once a year from my observations.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: