Skip to content

Apply --head filter client-side for Gitea/Forgejo pr list - #181

Merged
andrew merged 1 commit into
git-pkgs:mainfrom
CloudCorpRecords:fix/pr-list-head-filter-111
Oct 19, 2026
Merged

andrew merged 1 commit into
git-pkgs:mainfrom
CloudCorpRecords:fix/pr-list-head-filter-111

Conversation

@CloudCorpRecords

Copy link
Copy Markdown
Contributor

Fixes #111.

The Gitea/Forgejo list-pull-requests API (and the gitea SDK) expose no
head filter, so --head was accepted by the CLI and passed into
ListPROpts but silently dropped by the backend, listing every PR.

Filter client-side with GitHub-compatible semantics: an unqualified
--head matches the head branch name; a qualified owner:branch value
also requires the head repository owner to match (a head in the same
repository matches when the qualifier names the base repo owner).
The result limit is enforced after filtering.

Evidence

  • New test TestGiteaListPRsAppliesHeadFilter in gitea/prs_test.go
    covering unqualified and qualified head matching.

Honest limits

  • The Go toolchain was not available in this environment, so unit tests
    were not run locally; CI is the test backstop for build, vet, and tests.

The Gitea/Forgejo list-pull-requests API (and the gitea SDK) expose no
head filter, so --head was accepted by the CLI and passed into
ListPROpts but silently dropped by the backend, listing every PR.

Filter client-side with GitHub-compatible semantics: an unqualified
--head matches the head branch name; a qualified owner:branch value
also requires the head repository owner to match (a head in the same
repository matches when the qualifier names the base repo owner).
The result limit is enforced after filtering.

Fixes git-pkgs#111.

Signed-off-by: Rene Turcios <95189389+CloudCorpRecords@users.noreply.github.com>

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The head filter handles branch names and qualified fork owners correctly, with the result limit applied after filtering.

@andrew
andrew merged commit f34fde1 into git-pkgs:main Oct 19, 2026
5 checks passed
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.

forge pr list --head owner:branch does not apply --head with gitea/forgejo

2 participants