Skip to content

Numberless patches - #23

Draft
hroncok wants to merge 8 commits into
fedora-python:masterfrom
hroncok:numberless
Draft

Numberless patches#23
hroncok wants to merge 8 commits into
fedora-python:masterfrom
hroncok:numberless

Conversation

@hroncok

@hroncok hroncok commented Sep 4, 2026

Copy link
Copy Markdown
Member

I still need to review this thoroughly. Based on #21

befeleme and others added 8 commits September 3, 2026 14:56
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants