Scratch that, on MOST projects that's the case.
Scratch that, on MOST projects that's the case.
But it can make for long commit messages. Why also includes what alternatives you considered, and why you didn't use those.
I also like to have a digital "worksheet" for each change I do, where all my thoughts and research goes. So if all else fails, I can reference that. But no-one else can, so I like to transfer as much knowledge as possible to the commit message. At the same time, some of these go on for 5 or more pages. They also tend to be very messy. I'm not sure if it's all appropriate for a commit message.
The whole point of a version control system is that it contains everything related to the code. On lots of web dev and game projects you also commit the finalized assets (the generated javascript from coffeescript, the compressed 3d textures, etc. etc.)
(Of course, the commit message refers to issue ID, and vice versa.)
There are man times when I have seen a crappy piece of code that I wrote a while ago, and decide to "tidy it up". The I test it, then remember there is a strange edge case that required me to write it the "crappy" way rather than the clean way. It always gets commented the second time.
There was one project I saw that had a two line commit message, and there were 29,000 changed lines across 44 files. Who does that?
Of course, we can debate over and other whether mass-correcting existing files is actually helpful (one unofficial rule we have here is "only use the auto-formatter on code you've personally worked on or have taken over responsibility for", because it affects the blame history).
Also, I changed my name last year, and when I did that, I ran a mass find-and-replace to correct my credit in every Javadoc I'm credited on (I particularly detest my deadname, and I want it dead and buried), with the commit message being something like "Correct my credit to match my new name".
I'm currently working on the changes that will actually document what is otherwise a walk of code.
The road to hell is paved with good intentions.
However, my example was a project that was around for about 3 years at that point, and it was basically just labelled: "Upgrade to version 2.0".
Face → Palm
Yes, nobody cares about your commit messages until there's a bug or a major refactor. By then, if the commit messages suck, it's too late to do anything about it.
"Programs are meant to be read by humans and only incidentally for computers to execute"
Is never more true than when you're trying to fix bugs or make improvements. A project you can't improve is a dead project.
(edit: He made this change after a lot of discussion with a bunch of people, and he also sent out a mass email describing the changes to the structure, so he wasn't totally being irresponsible there.)
I'd assume the keys are the commit hashes? Now how to search github for them...
Code typically isn't rocket science. It's the human knowledge that goes into it that's irreplacable.
Example 1: OK, you're using a third-party CSV parser instead of the one built into the standard library. Why? If your code is crap but well-documented, I can read what you were thinking: "Using non-standard CSV parser because the standard one chokes on files bigger than 2gb" At that point I can refactor your code, or perhaps see that this issue has been fixed in a newer version of the standard library. Or maybe I realize that you confused gigabits and gigabytes and you made a bad choice in the first place, and I realize I can safely remove this dependency. But if your code is tight but undocumented... I would have no idea why this third-party library is being used unless I do some painful trial-and-error that still might not definitively answer the why.
Example 2: You inherit Mary's code. It calculates commissions for our salespeople. The code is sloppy and convoluted, because the sales guys change the commission formulas every month... and these changes have been happening for over ten years, often on very short notice, often contradicting basic assumptions made when the software was originally architected. But Mary documented every change. Which is good, because the fucking sales guys sure don't. Her code is literally the company's only coherent record in the entire company of the commission process. Remove her comments and commit messages, and none of the code would make sense, even if it was tightened up into a sounder codebase of seven modules with 300 LoC each instead of ten modules with 500 LoC each.
So yeah. Totally fictional choice but I'll take documentation every time. Code is just code, I can fix it.
(Both those examples are fictional, but I've been coding professionally for nearly twenty years and I've seen variations of them countless times...)
99% of the time what you want is to understand the current code--or at least code at a specific past point in time--as opposed to every transition that occurred.
For the CSV parser, I'd rather see a comment ("/* We use this for >2gb support */") or a test case ( testOverTwoGigsParseable() ) would be a lot more useful than any level of discipline over commit-messages.
For Mary's commission-calculator, it sounds like nobody has access to good "whys" anyway, because they boil down to "salesguy X insisted on it". Instead, the commits are functioning as an auditing/blame tool.
I got a new computer and when I was getting rid of my old one, it didn't occur to me to push all the commits or save the git repo. So, my next commit consisted of all the changes for that entire month.
I was able to retrieve the full final content from the place where it was being uploaded to, but that didn't have any git-related files.
If you make a commit, it would copy over with that, because it's written in that folder.
I'd wager that you simply copied the main files over and tried to re-commit.
"Issue #27" is terrible. Something like (in C#/VS) "Execute CodeMaid against solution" would be perfectly fine.
I miss having a system like that...
[1] https://help.github.com/articles/closing-issues-via-commit-m...
[2] https://confluence.atlassian.com/display/BITBUCKET/Resolve+i...
Some other examples: "Fixes to make work", "Left Over", and their most common message " ".
They're nice guys to work with, but their VC habits are awful.
No excuse, beyond it usually being a minor change well documented in the code ( I always write comments ) and me being utterly buried under work... You know, start the day with 20 things to do, crack off 4 of them and have 23 things in queue at the end of your day.
The "." was sort of a placeholder for "Fuck This, I'm ready to quit." ( and I did eventually )