2 ms·
At first I thought someone was asking Linus to do this. But this comes up over and over and people should really start doing it! Especially on large and/or wel
by billpatrianakos 15y ago
At first I thought someone was asking Linus to do this.
But this comes up over and over and people should really start doing it! Especially on large and/or well known projects. This isn't just something that's useful to others but it can help you too! I'm a naturally long-winded person but the point isn't to write an essay, you just have to sum it up on line 1 give some context and details for the commit, then let us know who you are and how to get in touch.
Fortunately I've never had to revert Amy changes in my work (weird, right?) but if and when that day comes I'll be prepared. 99% of my work is done alone but I still write some decent commit messages. Who here remembers the date of your changes? Do you remember the exact state of the project at that time? Even if you remember that "well, the project was in X state Y commits ago" it'll only help you for about 5 commits max then you'll forget.
You need to know what you were doing and so do others. Even if you don't plan on working with others, I'd you're on GitHub with a public repo someone may unexpectedly like your project and want to see what's up with each commit. I recently had a project up on github that I thought was literally only useful for myself. It was a basic brochure style website for someone I made as a favor. Well it turns out someone here on HN wanted to learn to code, got in touch with me privately, then started exploring my github repos nth at guy actually used the stupid website I was building as a way to look at some code, tear it apart, and see how it worked. I was flattered and now I'm glad I write decent commit messages even if I'm only working with myself.
The point is, you'll never know when someone else or even yourself will need to look back at the logs and if the commit message is nothing but a date or something like "fixed the link" then you aren't reverting to a known past state - you're guessing.
I know a lot of Git newbies get scared after pressing return in the command line and nano or whatever built in text editor pops up. I didn't know how to end the commit message the first few times and save it or get back to the "normal" terminal so this may be part of why this happens but not a big part.
In any case, I feel strongly that this is an important thing that's overlooked and I'm glad it was brought up again. Hopefully people do it.