Open sidnt opened 8 months ago
well. not so simple. because different files touched by reformatting, might as well have different commit messages. and again, we are clobbering their own meaningful message history by picking up the last commit message.
what can we do in this situation?
let's say we run
pnpm format
on a clean working tree. we get some changes and we commit them, in one neat commit, with messagereformatting code
so that we know this change was introduced when we reformatted the codebase.however, when viewing git blame for lines edited this way, we see the commit message
reformatting code
. while, we might want to understand why this line was written. so we inevitably open file history and see the last commit message for that line.if the message is just around linting, we lose git blame upfront regarding why that line was introduced, as described by a previous meaningful commit message.
what can we do in this situation? simple. we can just copy the message over from the last commit using
git commit --reuse-message=HEAD