Allow creation of empty pull requests #9615

Closed
opened 2025-11-02 08:44:34 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @maximilize on GitHub (Sep 25, 2022).

Feature Description

Our development flow includes empty pull requests. Once one developer starts to work on some issues, he is creating a new PR, prefixed with WIP: and is using time tracking there as well.

After the recent update, it's not possible to open empty PR's anymore. This is the message we get:
These branches are equal. There is no need to create a pull request.

Via the gitea cli, it's still possible. But that's not a convenient option for most use cases.

Screenshots

No response

Originally created by @maximilize on GitHub (Sep 25, 2022). ### Feature Description Our development flow includes empty pull requests. Once one developer starts to work on some issues, he is creating a new PR, prefixed with `WIP: ` and is using time tracking there as well. After the recent update, it's not possible to open empty PR's anymore. This is the message we get: `These branches are equal. There is no need to create a pull request.` Via the gitea cli, it's still possible. But that's not a convenient option for most use cases. ### Screenshots _No response_
GiteaMirror added the type/proposaltype/feature labels 2025-11-02 08:44:34 -06:00
Author
Owner

@MirisWisdom commented on GitHub (Jun 9, 2023):

Just realised that you can actually create empty requests. To do it, simply create a separate branch, even if you are working on your own fork. Gitea will let you create an empty PR when the branch name differs:

Same Branch Name Different Branch Name
Screenshot from 2023-06-09 10-36-53 Screenshot from 2023-06-09 10-36-47

I'm keeping the stuff below for posterity.

Similar situation here -- it would definitely be awesome to allow the creation of empty Pull Requests.

Asides from the Gitea CLI, there is another hacky way to create an empty PR, and that is to push an empty commit:

git checkout -b branch-for-pr
git commit --allow-empty --allow-empty-message
git push --set-upstream origin branch-for-pr

# 1. create pr in gitea
# 2. to delete the empty commit:
#    git reset --hard HEAD~1 && git push --force
@MirisWisdom commented on GitHub (Jun 9, 2023): Just realised that you can actually create empty requests. To do it, simply create a separate branch, even if you are working on your own fork. Gitea will let you create an empty PR when the branch name differs: | Same Branch Name | Different Branch Name | | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | | ![Screenshot from 2023-06-09 10-36-53](https://github.com/go-gitea/gitea/assets/10241434/1b72a77a-16ad-477d-b548-2b80673c4bf7) | ![Screenshot from 2023-06-09 10-36-47](https://github.com/go-gitea/gitea/assets/10241434/aa99fc1d-40b7-401c-a823-759c2fdc5b3d) | I'm keeping the stuff below for posterity. > Similar situation here -- it would definitely be awesome to allow the creation of empty Pull Requests. > > Asides from the Gitea CLI, there is another hacky way to create an empty PR, and that is to push an empty commit: > > ```sh > git checkout -b branch-for-pr > git commit --allow-empty --allow-empty-message > git push --set-upstream origin branch-for-pr > > # 1. create pr in gitea > # 2. to delete the empty commit: > # git reset --hard HEAD~1 && git push --force > ```
Author
Owner

@lunny commented on GitHub (Jun 9, 2023):

Yes, I think this has been resolved.

@lunny commented on GitHub (Jun 9, 2023): Yes, I think this has been resolved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9615