-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
At the moment the advice is:
- to avoid intermediate merge commits
- to squash your commits against a dev rebaseline.
I feel that this is a one-size fits all approach an it doesn't, as a single commit can make it very difficult to see what is what if the change is anything but trivial.
- In Tidying up the Library coding styles #1028, I discuss that we've often got dead code inline with large blocks of
#if 0
or '//' commenting out, The layout and spacing can be poor and what would be very useful commenting is omitted. Also the most appropriate Lua argument checking API calls aren't used. We should have a standard template and practice for laying out out modules. - I have suggested that if any of us does non-trivial work on a module then it makes sense to do a (1) pass at the same PR.
- After the first submission of the PR, we may get review comments that need incorporating.
My suggestion is that whilst we should expect contributors to squash working commits, it really makes it a lot easier to review changes if we split the PR into up to four commits, viz: (a) Formatting and dead code removal -- here in principle the binary output of the two versions would be unchanged. (b) Tidy up and move to template compliant error checking, etc. (c) The functional changes that triggered the issues / work. (d) The changes are a result of any issue and PR comments.
I would also suggest we adopt a naming convention for commits, E.g. PR title followed by code tidy / rework checking / main changes / Review.
Lastly I am not a Github expert but what worries me about fetching dev and rebaselining against it is that this might back out other changes made in parallel. My standard approach now is:
- If it's a complex change do it against a recent change and commit it.
git fetch nodemcu dev:dev-<some-branch>
where the branch name reflects the PRgit checkout -f :dev-<some-branch>
- Either
git cherry-pick
commit at (1) or do agit diff
on (1) to a/tmp/xxx.diff
and patch the working branch with this. If it is a simple change just do it. - Devise a test to test the change; do a make; blow to ESP and test it.
- Commit it.
git push terrye dev-<some-branch>:dev-<some-branch>
- Use github interactively to issue the PR against
nodemcu/nodemcu-firmware:dev
- Update the raising issue and add any further b/g comment to the PR.
- Roll up any agreed PR comments into an additional commit on my local instance and push this to
terrye
.
My aim here is to do (3) - (10) in one working session, say no more than a couple of hours.
If anyone has any suggestions on how to improve this then I'd be very interested. If not then why not just suggest this or something like this.