From 4f859070b3b7e2f9aca44aa741bfc0ff20fc45e8 Mon Sep 17 00:00:00 2001 From: Michael Sarahan Date: Fri, 9 Oct 2026 10:46:25 -0500 Subject: [PATCH 1/3] Simplify patch README commands following review feedback --- recipe/patches/README.md | 52 ++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/recipe/patches/README.md b/recipe/patches/README.md index a238c8548..122424f8d 100644 --- a/recipe/patches/README.md +++ b/recipe/patches/README.md @@ -4,6 +4,11 @@ Use the existing series from the target feedstock branch and the CPython tags for its old and new releases. The example below assumes sibling `cpython` and `python-feedstock` checkouts; adjust the paths and tags as needed. +Run the commands in stages. If the rebase reports conflicts, resolve them before +continuing: preserve the intended patch changes and file line endings, do not +let an editor add a final newline to a file that lacks one, stage each resolution, +and run `git rebase --continue`. + ```bash old=v3.14.7 new=v3.14.8 @@ -12,43 +17,38 @@ cd cpython git switch -c feedstock-patches "$old" git am -3 ../python-feedstock/recipe/patches/*.patch git rebase --onto "$new" "$old" -``` - -The glob selects only patch files in numbered order. Apply all patches, including -those selected only on other platforms in the recipe. `git am -3` can fall back -to a three-way merge when the required Git blobs are available. -Resolve any rebase conflicts, preserving the intended patch changes and file -line endings. Do not let an editor add a final newline to a file that lacks one. -Stage each resolution and run `git rebase --continue`. - -Export to a separate directory so generated patches are not mixed with the old -series, then restore the mixed line endings required by Windows patches: - -```bash +# Continue here once the rebase has completed successfully. mkdir ../refreshed-patches git format-patch --no-signature -o ../refreshed-patches "$new" for f in ../refreshed-patches/*.patch; do python ../python-feedstock/recipe/patches/make-mixed-crlf-patch.py "$f" done + +# Verify the exported series on a clean checkout of the new tag. +patched_head=$(git rev-parse HEAD) +git switch --detach "$new" +git am ../refreshed-patches/*.patch +git diff "$patched_head" HEAD --exit-code + +# Copy the verified patches back to the feedstock. +cp ../refreshed-patches/*.patch ../python-feedstock/recipe/patches/ ``` +The glob selects only patch files in numbered order. Apply all patches, including +those selected only on other platforms in the recipe. `git am -3` can fall back +to a three-way merge when the required Git blobs are available. + +Exporting to a separate directory keeps generated patches apart from the old +series. The helper restores the mixed line endings required by Windows patches. +The rebased series remains on `feedstock-patches` while the exported patches are +verified in a detached checkout. The diff check must succeed before copying the +patches back; it confirms that applying them reproduces the rebased source tree. +Preserve patch authorship, metadata, ordering, and recipe references. + For Windows Command Prompt, the application step has this equivalent (use `%%f` instead of `%f` in a batch file): ```bat for /f "delims=" %f in ('dir /b /s /on ..\python-feedstock\recipe\patches\*.patch') do git am -3 "%f" ``` - -Before replacing the feedstock's patches, verify the exported series with -`git am` on a clean checkout of the new tag: - -```bash -git worktree add --detach ../cpython-patch-check "$new" -git -C ../cpython-patch-check am ../refreshed-patches/*.patch -git diff HEAD "$(git -C ../cpython-patch-check rev-parse HEAD)" --exit-code -``` - -The final check confirms that applying the exported patches reproduces the -rebased source tree. Preserve patch authorship, metadata, ordering, and recipe -references when copying the regenerated series back to the feedstock. From 25143533c0c766c430eaed27c46f3f054a864348 Mon Sep 17 00:00:00 2001 From: Mike Sarahan Date: Fri, 9 Oct 2026 13:45:22 -0500 Subject: [PATCH 2/3] Update README.md Co-authored-by: Isuru Fernando --- recipe/patches/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipe/patches/README.md b/recipe/patches/README.md index 122424f8d..0719cd33e 100644 --- a/recipe/patches/README.md +++ b/recipe/patches/README.md @@ -19,10 +19,10 @@ git am -3 ../python-feedstock/recipe/patches/*.patch git rebase --onto "$new" "$old" # Continue here once the rebase has completed successfully. -mkdir ../refreshed-patches -git format-patch --no-signature -o ../refreshed-patches "$new" -for f in ../refreshed-patches/*.patch; do - python ../python-feedstock/recipe/patches/make-mixed-crlf-patch.py "$f" +rm *.patch +git format-patch --no-signature "$new" +for f in *.patch; do +python ../python-feedstock/recipe/patches/make-mixed-crlf-patch.py "$f" done # Verify the exported series on a clean checkout of the new tag. From 5991490b4b9928806b70eefe8043c4e5cf028995 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Fri, 9 Oct 2026 11:58:33 -0700 Subject: [PATCH 3/3] Simplify patch file application instructions Updated README to reflect changes in patch file handling. --- recipe/patches/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/patches/README.md b/recipe/patches/README.md index 0719cd33e..1e5fab433 100644 --- a/recipe/patches/README.md +++ b/recipe/patches/README.md @@ -28,11 +28,11 @@ done # Verify the exported series on a clean checkout of the new tag. patched_head=$(git rev-parse HEAD) git switch --detach "$new" -git am ../refreshed-patches/*.patch +git am *.patch git diff "$patched_head" HEAD --exit-code # Copy the verified patches back to the feedstock. -cp ../refreshed-patches/*.patch ../python-feedstock/recipe/patches/ +cp *.patch ../python-feedstock/recipe/patches/ ``` The glob selects only patch files in numbered order. Apply all patches, including