Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCommit/change history #12
Open
Comments
I understand what you say but that info should be in comments in code. |
That's debatable. Comments need updating to stay correct and consistent. Commit logs will always reflect the changes they refer to. But regardless, for many projects, commit logs contain invaluable information that isn't found elsewhere. Whether it "should" have been encoded in code comments or not, it wasn't, and won't be. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's stated in the FAQ that:
And the guide confirms:
I understand the need to save space, but I want to point out that in some cases, the change history can be extremely important for understanding why code was written.
As an example, in the course of my work, I regularly need to read and understand the source code of the Linux kernel. A great deal of information about how the code works, and how and why it came to be designed and organized the way that it is, is found in the commit history.
In any large project that has matured over many years and seen many mistakes made, bugs fixed, edge cases covered, and lessons learned, all of that knowledge is in the commit logs. Many a developer who has worked on someone else's code has cried out to themselves, the universe, or their favourite deity, "What the hell is this line for? What on earth were they thinking?". And the first (and sometimes only) place to look for answers is the commit logs.
I know there are storage costs and practicality to consider, but I would strongly suggest that commit history be preserved, at least for some projects. Possible heuristics could be importance/popularity and complexity (lines of code?). I don't presume to know enough to tell you how to manage the archive, but as a developer, I can tell you that some codebases almost cannot be worked on without commit history.