Skip to content

Conversation

@siccous
Copy link

@siccous siccous commented Dec 6, 2024

Check number of commits between head and base during PR creation, if not greater than zero return error.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 6, 2024
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Dec 6, 2024
@wxiaoguang
Copy link
Contributor

Check number of commits between head and base during PR creation, if not greater than zero return error.

Well, I know some users ever requested to "allow to create empty PR" because they need an empty PR to start their work (different teams have different workflows)

So, I guess it won't hurt without such check? 🤔

@siccous
Copy link
Author

siccous commented Dec 6, 2024

Understand, it hits me because it is different from GitHub API behaviour.

Details in my issue #32743.

@wxiaoguang
Copy link
Contributor

Understand, it hits me because it is different from GitHub API behaviour.

A lot of Gitea's behaviors are different from GitHub, actually there is no compatibility guaranteed, Gitea is an independent project.

And you see, the CI tests fail 😅

@wxiaoguang wxiaoguang marked this pull request as draft December 7, 2024 03:24
@lunny
Copy link
Member

lunny commented Dec 7, 2024

It's useful to create an empty pull request especially for #31899

@yp05327
Copy link
Contributor

yp05327 commented Dec 9, 2024

Actually, IMO it is a feature in Gitea which is different from GitHub.
And you can also create empty PR from Web UI. So the behavior should be same between them at least.

@yp05327 yp05327 linked an issue Dec 9, 2024 that may be closed by this pull request
@siccous
Copy link
Author

siccous commented Dec 9, 2024

Okey, is there any interest to make it configurable as an argument in the create PR API call? If not, then feel free to close this PR.

Thank you all.

@wxiaoguang
Copy link
Contributor

is there any interest to make it configurable as an argument in the create PR API call?

I think it is feasible if there are tests to cover it.

@wxiaoguang
Copy link
Contributor

Inactive for long time, feel free to reopen if there would be new progress.

@wxiaoguang wxiaoguang closed this Apr 20, 2025
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jul 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty PR can be created through API

6 participants