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

Add merge style fast-forward-only #28954

Merged
merged 10 commits into from
Feb 12, 2024
Merged

Conversation

chrisnc
Copy link
Contributor

@chrisnc chrisnc commented Jan 27, 2024

With this option, it is possible to require a linear commit history with the following benefits over the next best option Rebase+fast-forward:
The original commits continue existing, with the original signatures continuing to stay valid instead of being rewritten, there is no merge commit, and reverting commits becomes easier.

Closes #24906

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 27, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 27, 2024
@github-actions github-actions bot added modifies/translation modifies/api This PR adds API routes or modifies them labels Jan 27, 2024
@chrisnc
Copy link
Contributor Author

chrisnc commented Jan 27, 2024

I'm missing the localization for the new UI, but otherwise I think it's close? This is my first contribution so I'm sure I've missed some other things, too. Reviews appreciated!

@delvh delvh added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Jan 27, 2024
Copy link
Member

@delvh delvh left a comment

Choose a reason for hiding this comment

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

modules/structs/repo.go Show resolved Hide resolved
modules/structs/repo.go Show resolved Hide resolved
services/pull/merge_ff_only.go Show resolved Hide resolved
templates/repo/settings/options.tmpl Outdated Show resolved Hide resolved
@delvh delvh changed the title Add a fast-forward-only merge style. (#24906) Add merge style fast-forward-only Jan 27, 2024
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 28, 2024
With this option, it is possible to require a linear commit history with
the following benefits over the next best option Rebase+fast-forward:
the original commits continue existing, with the original signatures
continuing to stay valid instead of being rewritten, there is no merge
commit, and reverting commits becomes easier.

Closes go-gitea#24906
@delvh
Copy link
Member

delvh commented Jan 28, 2024

Oh, by the way:
You don't need to force push your branch.
We'll squash merge it anyway, so these other commits won't be added to the history, and force pushes make reviewing painful.

@chrisnc
Copy link
Contributor Author

chrisnc commented Jan 30, 2024

Addressed the feedback so far, and the integration tests I added are passing. When I test this locally with a repository configured with only fast-forward-only merges allowed, I see the "This branch can be merged automatically" message for an outdated branch, which seems wrong, so I'll look into how to address that... Looked into this, and there is already IsBlockedByOutdatedBranch which is controlled by a separate repository setting. I think it's okay to leave this as-is, but let me know if you disagree.

@delvh
Copy link
Member

delvh commented Jan 30, 2024

the integration tests I added are passing

CI disagrees, and says the routes haven't been found.

@chrisnc
Copy link
Contributor Author

chrisnc commented Jan 30, 2024

CI disagrees, and says the routes haven't been found.

Indeed. I ran make integrations.sqlite.test and it passed, but I guess it wasn't clear how to run them. Will fix the errors.

Update: fixed.

@chrisnc chrisnc marked this pull request as ready for review February 4, 2024 22:23
@chrisnc chrisnc requested a review from delvh February 4, 2024 22:33
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 5, 2024
@chrisnc
Copy link
Contributor Author

chrisnc commented Feb 11, 2024

I think this is ready to go other than translations. Should I make an attempt at those or is there some other process for doing that?

@delvh
Copy link
Member

delvh commented Feb 11, 2024

Ah, forgot to approve. Sorry.
No, they will be added automatically from Crowdin once the PR is merged.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 11, 2024
@delvh delvh added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 11, 2024
@delvh delvh merged commit 47b5965 into go-gitea:main Feb 12, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.22.0 milestone Feb 12, 2024
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 12, 2024
@chrisnc chrisnc deleted the fast-forward-only branch February 13, 2024 05:48
zjjhot added a commit to zjjhot/gitea that referenced this pull request Feb 14, 2024
* giteaofficial/main: (38 commits)
  Document how the TOC election process works (go-gitea#29135)
  Runner tokens are multi use (go-gitea#29153)
  Fix Gitpod logic of setting ROOT_URL (go-gitea#29162)
  Remove jQuery from the user search form in admin page (go-gitea#29151)
  Dont load Review if Comment is CommentTypeReviewRequest (go-gitea#28551)
  Show `View at this point in history` for every commit (go-gitea#29122)
  [skip ci] Updated translations via Crowdin
  Add merge style `fast-forward-only` (go-gitea#28954)
  Use Markdown alert syntax for notes in README (go-gitea#29150)
  Refactor issue template parsing and fix API endpoint (go-gitea#29069)
  [skip ci] Updated translations via Crowdin
  Update some translations and fix markdown formatting (go-gitea#29099)
  Show more settings for empty repositories (go-gitea#29130)
  Update JS and PY dependencies (go-gitea#29127)
  Add alert blocks in markdown (go-gitea#29121)
  Remove obsolete border-radius on comment content (go-gitea#29128)
  Make blockquote border size less aggressive (go-gitea#29124)
  Drop "@" from email sender to avoid spam filters (go-gitea#29109)
  [skip ci] Updated translations via Crowdin
  Disallow duplicate storage paths (go-gitea#26484)
  ...
silverwind pushed a commit to silverwind/gitea that referenced this pull request Feb 15, 2024
With this option, it is possible to require a linear commit history with
the following benefits over the next best option `Rebase+fast-forward`:
The original commits continue existing, with the original signatures
continuing to stay valid instead of being rewritten, there is no merge
commit, and reverting commits becomes easier.

Closes go-gitea#24906
silverwind pushed a commit to silverwind/gitea that referenced this pull request Feb 20, 2024
With this option, it is possible to require a linear commit history with
the following benefits over the next best option `Rebase+fast-forward`:
The original commits continue existing, with the original signatures
continuing to stay valid instead of being rewritten, there is no merge
commit, and reverting commits becomes easier.

Closes go-gitea#24906
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Feb 26, 2024
With this option, it is possible to require a linear commit history with
the following benefits over the next best option `Rebase+fast-forward`:
The original commits continue existing, with the original signatures
continuing to stay valid instead of being rewritten, there is no merge
commit, and reverting commits becomes easier.

Closes go-gitea#24906
Copy link

github-actions bot commented Mar 1, 2024

Automatically locked because of our CONTRIBUTING guidelines

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them modifies/docs modifies/translation size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Merge Style: Fast-Forward Only (--ff-only)
4 participants