This Engineering Note post discusses the mistakes I made creating the PR. These mistakes have taught me important lessons. See the summary if you are in a hurry :-)
For the last several days my inner critic has been screaming at me.
The critic wasn't wrong.
I chose a highly inefficient plan for fixing the bug.
Background
PR
#4627 introduced the bug. It escaped detection because it seemed to affect only cut/copy/paste in the Completion pane. This pane shows all tab completions. It's rare to want to copy text from it. By great good fortune, however, I did discover the bug soon after merging the PR.
The bug
seemingly arises from what git bisect labels the
first bad commit: rev
cf2d872. I say seemingly because it's possible that later commits also played a part. I still don't know for sure.
My first strategy was to merge the later commits into the first bad commit, but that didn't work well. There were hard-to-resolve conflicts during the merge, and the bug persisted after several attempts at resolving the conflicts.
Panic
At this point I felt stuck, but I didn't then realize how important it was to choose my strategy carefully. In my ignorance, I chose to revert all the files in PR #4627 to their versions in the 6.8.8 branch (the same as master). Yes, that did indeed "fix" the problem, but those reversions clobbered a lot of work!
In retrospect, my urgent priorities should have been:
- Revert as few files as possible.
- Revert as few lines of code as possible.
Here's how.
Step one
I could have reverted just the most likely culprit file: qt_text.py, creating a separate branch for this experiment. Other files may have had to change as a result, but it shouldn't have taken too much work to get a workable executable.
There would have been no guarantee that this single reversion would have worked. If it didn't, I might have tried to revert just one other file.
Step two
After isolating the culprit files, instead of actually reverting those files, I could have reverted only the actual code changes in the changed files. There would be no need to revert annotations!
I would then create another branch in which to try reverting only the executable code. If that branch worked, my task would be essentially complete. For sure, I would have narrowed the possible culprits to a comparatively few lines of code.
Summary
This ENB confronts serious mistakes in strategy. As a result, PR
#4631 reverts way too much code! If I had it to do over again, I would have tried to find the minimal number of
culprit files and then focus on minimizing the number of
executable lines in those files.
There is never any need to panic. git ensures that no code (and
no checkpoint) ever disappears.
It's way too late to undo my mistakes. I'm stuck with PR
#4631 as it is. I'll release this PR today, but issue
#4634 suggests undoing still more reversions.
All comments, questions, and suggestions are welcome.