Skip to content
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

Edit HEAD of a PR to associate with another branch #33883

Open
AdamMajer opened this issue Mar 14, 2025 · 5 comments
Open

Edit HEAD of a PR to associate with another branch #33883

AdamMajer opened this issue Mar 14, 2025 · 5 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@AdamMajer
Copy link
Contributor

AdamMajer commented Mar 14, 2025

Feature Description

In a typical workflow,

  1. do some changes on branch foo
  2. create a PR
  3. add some commits to branch foo
  4. PR is updated

Now, how can I turn this automatic branch following off?

The reason is specific workflows that can run long time and where changes on the source branch may not be wanted in the PR.

In the API https://demo.gitea.com/api/swagger/#/repository/repoEditPullRequest I can't set the HEAD branch to another branch. The other branch could even refer to same commitid.

Screenshots

No response

@AdamMajer AdamMajer added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Mar 14, 2025
@wxiaoguang
Copy link
Contributor

The reason is specific workflows that can run long time and where changes on the source branch may not be wanted in the PR.

It sounds like something "skip ci"?

@AdamMajer
Copy link
Contributor Author

It's not about CI. It's more analogous to merging from a devel branch to a stable branch when maintainer of the stable branch likes it. But instead of creating a new label, they just do a PR from devel -> stable.

I guess a workaround could be to close the original PR and replace it with another where the commit id is on a "PR_to_stable" branch and not devel branch itself. But it would be nice to be able to do this via API, and "retarget" the source of the PR to specific commit id.

@wxiaoguang
Copy link
Contributor

Hmm, I think it's almost impossible at the moment. The PR system's design is "a PR always follows its branch", this mechanism is widely used everywhere in code.

@AdamMajer
Copy link
Contributor Author

That's fine, but it would be nice to be able to at least retarget to a different source branch name that the tooling creates.

@AdamMajer AdamMajer changed the title Edit HEAD of a PR to disassociate from branch or set it to specific commit id Edit HEAD of a PR to disassociate from branch or set it to specific commit id or another branch Mar 14, 2025
@AdamMajer
Copy link
Contributor Author

I see that this requires branches everywhere. So, having ability to reset the branch to different branch would be sufficient here.

@AdamMajer AdamMajer changed the title Edit HEAD of a PR to disassociate from branch or set it to specific commit id or another branch Edit HEAD of a PR to associate with another branch Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

2 participants