Numberless patches - #23
Draft
hroncok wants to merge 8 commits into
Draft
Conversation
- How to install (in parallel to importpatches) - That the script makes assumption about your remote's name
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Patches no longer need NNNNN-prefixed commit messages, filenames, or Patch declarations. Mode is auto-detected per run (from commit messages in importpatches, from spec Patch declarations in exportpatches); mixing numbered and numberless conventions errors out instead of guessing. A new --rhel8-compat flag lets importpatches still emit sequential Patch1:, Patch2:, ... declarations (no semantic meaning) for RPM on RHEL 8, which lacks bare Patch: support; exportpatches recognizes that scheme too and never writes any number into a commit message in numberless mode. Also fixes a pre-existing bug in exportpatches where a trailing patch added to the spec without a numbered commit message got a doubled colon inserted (e.g. "00042:: Summary" instead of "00042: Summary"), as a side effect of the regex rewrite needed for mode detection. Fixes fedora-python#22 Assisted-By: Claude Sonnet 5
Lets exportpatches tag the result locally while skipping the push confirmation prompt and the actual git push calls, so it can be run end-to-end without touching a remote. Assisted-By: Claude Sonnet 5
Complements the pure-function unit tests with real end-to-end coverage: run importpatches.py/exportpatches.py as actual subprocesses against scratch upstream/dist-git git repos built under tmp_path, covering numberless creation, stale numbered patch removal, --rhel8-compat, mixed numbered/numberless commits erroring out, the numbered-mode trailing-unnumbered-patch number insertion, numberless modes never inserting a number, and --no-push. The upstream/dist-git repo shape is identical across tests, so the underlying git plumbing is built once per session into template repos and copied per test, instead of re-running git init/commit/tag/branch for every test. Assisted-By: Claude Sonnet 5
Spec parsing used to key patches by number in a dict, which silently kept only the last of any duplicate PatchN: lines. Now that patches are parsed into an ordered list, that accidental (and confusing) deduplication no longer happens on its own, so validate explicitly and fail loudly instead of applying both entries under one number. Assisted-By: Claude Sonnet 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I still need to review this thoroughly. Based on #21