Remix.run Logo
jraph a day ago

> But then comes somebody and decides to just flush your well curated history down the toilet (=delete it and start somewhere else from scratch) and then all the valuable metadata stored in the history is lost.

How does this happen? I haven't run into this.

> Maybe consider putting your energy into a good documentation inside the repository

I'd say both are valuable.

I use git log and git blame to try to understand how a piece of code came to be. This has saved me a few times.

Recently, I was about to replace something strange to something way more obvious to fix a rendering issue (like, in some HTML, an SVG file was displayed by pasting its content into the HTML directly, and I was about to use an img tag to display it instead), but the git log told me that previously, the SVG was indeed displayed using an img tag and the change was made to fix the issue that the links in the SVG were not working. I would have inadvertently reverted a fix and caused a regression.

I would have missed the reason a code was like this with a big "work" end of the day commit.

It would have been better if the person had commented their change with something like "I know, looks weird, but we need this for the SVG to be interactive" (and I told them btw), but it's easy to not notice a situation where a comment is warranted. When you've spent a couple of hours in some code, your change can end up feeling obvious to you.

The code history is one of the strategies to understand the code, and meaningful commits help with this.