-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use f-string in preference to "...".format() #98883
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is worth changing; it's good to point people to current best practices in tutorials.
Git Investigative Team accident report on the PR #98765 incidentThe Git Investigative Team has conducted a detailed analysis of the PR #98765 incident, and has reconstructed the sequence of events, probable cause/contributing factors and safety recommendations from the available information. Executive SummaryThe probable cause of the PR #98765 accident was committing remote and local changes without a
Timeline of EventsNote: Readers can follow along and safety explore the final state of the accident branch themselves using Accident Branch History
Accident Sequence
Aftermath and cleanup
Probable cause/contributing factorsThe probable cause of the PR #98765 accident was committing remote and local changes without a Directly contributing were:
Indirect contributing factors include:
Recommendations for authorsPreventative measures
Response actionsIf a
Also, in this situation:
Additional recommendations
Appendix: Full commit graphExpand for full commit graph
|
The branch you're creating your new branch from only matters isofar as what commit it happens to point to, such that the first commit on that branch will have that commit as its parent. After you create the new branch, it has no connection to the branch (or tag, or commit hash, or other ref) you created it off of, other than the commit that ref pointed to at the moment you created it will be the parent of the first commit in the branch. If both More detailsYou can think of commit in a branch as items in one-directional linked lists (they're actually more like trees, but let's keep things simple), each with some content and the static immutable hash of the parent commit. Branches are just mutable pointers to particular HEAD commit, and so you can think of them as linked lists of commits. The branch pointer gets "dereferenced" to the specific static commit hash when creating a new branch, so it doesn't matter what branch pointer you use, just what commit hash it was pointing to. Therefore, this is unrelated to your problem. The one potential area for problems is if you'd committed directly to your fork's
FYI, I added |
@CAM-Gerlach thanks for the detailed explanation. I will accept it as the gospel truth with the exception of this:
When the rejection first appeared, the very first thing I did was the best of my ability to follow the Thanks for the "make draft" suggestion as well. I have done that and will proceed to try updating the branch.... |
Here's my next dilemma. I updated using the above button, then in my checkout (I happened to be on my argparse-doc branch), I executed I then switched to my argparse-howto branch (the one for this PR) and executed
Looking back at the Lifecycle document it seems reasonable to suggest that users also execute |
Perhaps of use to this crowd, I opened a bug report for the devguide: |
This might be because your local remote-tracking branch for I use |
If your local feature branch was out of date with the branch you were pushing to, but it was up to date from the branch you were pulling from, then the branch you were pulling from vs. pushing to must have been different branches. My guess would be that you were trying to pull from your fork (
So, it would seem your other branch is tracking some branch, but it may not be the one you want. To confirm this was just an issue with your setup on that branch and not your remote/branch configuration, you could send the following output and I can double check. git remote -v
git remote show origin
git remote show upstream
git branch -vv
Instead of all that, you can simply specify |
I appreciate all the assistance trying to figure out what I might or might not have done to get myself into such a mess. @CAM-Gerlach I really hope there was some hefty automation behind that investigation and that it wasn't all human generated. It really wasn't necessary, but thanks just the same. I was happy to discover my initial mistake and strive to do better next time. It reminds me a bit of a forensic pathologist on a police drama using ambient temperature, cloud cover, wind speed and direction, and the type and location of maggots on a rotting corpse to determine time of death... :-) |
I took this out of draft mode. Whenever y'all are ready, feel free to merge and close. Thanks again for your help. |
Unfortunately, I'm not that smart and had way too much "fun" with it, heh. My notional idea for the framing was a nuclear reactor accident, although the actual structure, content, tone and phrasing were much more heavily inspired by NTSB aircraft accident reports, which I read way too much of in my spare time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @smontanaro
Thanks @smontanaro for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry @smontanaro and @JelleZijlstra, I had trouble checking out the |
GH-99033 is a backport of this pull request to the 3.10 branch. |
Thanks @smontanaro for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
GH-99034 is a backport of this pull request to the 3.11 branch. |
(cherry picked from commit 1fd20d0) Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
(cherry picked from commit 1fd20d0) Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
While this does modernize the argparse tutorial example code in a trivial way, I'm doing this mostly to see if I can cleanly generate a PR which doesn't get all messed up in the face of various changes (see below).
For those reading along, I think my error was that I created my working branch from origin/main (
smontanaro/cpython
, which was up-to-date w.r.t.python/cpython
at the time of the branch, and updated periodically) instead of following this instruction in Lifecycle of a Pull Request and branching fromupstream/main
:So, if you have been dragged here by my references (@AlexWaygood, @JelleZijlstra, @CAM-Gerlach), I would appreciate your feedback on my presumed error.
No matter whether this seems worth accepting or not (I don't really care), please leave this open for a day or two so I can continue messing around with things to see if I can break it again (hopefully not).