3 ms·
IMHO: 1) Just ask whatever you want, no limits, but without expecting it to be done. There is just the possibility that it will be done. 2) Provide as many de
by antirez 10y ago
IMHO:
1) Just ask whatever you want, no limits, but without expecting it to be done. There is just the possibility that it will be done.
2) Provide as many details as possible so that the maintainer does not have to context-switch to understand what's going on.
Point "2" is very important. Example: pull request subject is "fix hash table crash". Only change is a one liner like:
- if (next) {
+ if (next && ht->used != 0) {
No mention about what are the states causing the crash. Now, as a maintainer you HAVE to understand what's going on, you can't blindly merge a commit otherwise you'll likely merge many things that are harmful instead of fixes.
So now good luck with stopping with what you were doing and understanding what happens if ht->used is not 0 in that case, and the corner case that triggered it.
Instead in the original PR description, the contributor shold have written: when the hash table is reset, if there is a running iterator, next will be NULL because bla bla bla. Testing for empty hash table instead bla bla bla.
Now your effort is 30 seconds... Understad, merge, say thank you.
- Ajedi32 10y agoAlso if possible include a unit test in the PR, maybe even in a separate commit. For example, let's say I'm a project maintainer and I get a PR with two commits. The first commit just adds a test case, and Travis has marked the build for that commit as failed. The second commit includes a fix for that case and Travis shows that the tests pass when run on that commit. That's the sort of PR I can confidently merge without even having to leave GitHub's web UI.