jojo/services/doctor
Saibotk 8154ea5bea fix(doctor): remove broken mergebase check (#12023)
Fixes https://codeberg.org/forgejo/forgejo/issues/6163
Fixes https://codeberg.org/forgejo/forgejo/issues/3343

The merge base doctor check & fix was broken and could introduce irreversible "fixes" to wrong merge bases for PRs using the `fast-forward` and `rebase-and-merge` strategies.

The mergebase fix was originally introduced in a migration [0] to fix an existing issue [1] in the merge code in 2020.
Later added as a doctor command without explanation [2].

We decided to remove this check, as there is no apparent reason for it to still be necessary or any PR merge base state being out of sync with the current implementation.
It does more harm to keep the code in and there is no way to fix `fast-forward` and `rebase-and-merge` PRs, due to their merge implementation.

`fast-forward`: The git state inherently cannot reconstruct a merge base in this scenario by design.
`rebase-and-merge`: Is rebased on a temporary repository clone and thus might receive a different merge base, depending on how far the target branch is ahead.

[0]: 4a2b76d9c8
[1]: 4a2b76d9c8
[2]: d26885e2bf (diff-84d6d60112991392d6ba2cae4cd919fb3ee8afb8)

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. All work and communication must conform to Forgejo's [AI Agreement](https://codeberg.org/forgejo/governance/src/branch/main/AIAgreement.md). There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [x] This change will be noticed by a Forgejo user or admin (feature, bug fix, performance, etc.). I suggest to include a release note for this change.
- [ ] This change is not visible to a Forgejo user or admin (refactor, dependency upgrade, etc.). I think there is no need to add a release note for this change.

*The decision if the pull request will be shown in the release notes is up to the mergers / release team.*

The content of the `release-notes/<pull request number>.md` file will serve as the basis for the release notes. If the file does not exist, the title of the pull request will be used instead.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12023
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Saibotk <git@saibotk.de>
Co-committed-by: Saibotk <git@saibotk.de>
2026-04-08 16:20:19 +02:00
..
actions.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
authorizedkeys.go feat: ensure only expected ssh public keys are in authorized_keys file (#10010) 2025-11-09 01:06:04 +01:00
breaking.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
checkOldArchives.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
dbconsistency.go chore: rename 'migrations' to 'gitea_migrations' 2025-10-14 14:40:49 -06:00
dbversion.go chore: rename 'migrations' to 'gitea_migrations' 2025-10-14 14:40:49 -06:00
doctor.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
fix8312.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
fix16961.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
fix16961_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
heads.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
lfs.go chore: fix typos throughout the codebase (#10753) 2026-01-26 22:57:33 +01:00
misc.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
packages_nuget.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
paths.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
push_mirror_consistency.go chore: add modernizer linter (#11936) 2026-04-02 03:29:37 +02:00
repository.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
storage.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
usertype.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00