You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/docs/content/doc
zeripath 198342efe4
Add setting to disable the git apply step in test patch (#22130) (#22170)
Backport #22130

For a long time Gitea has tested PR patches using a git apply --check
method, and in fact prior to the introduction of a read-tree assisted
three-way merge in #18004, this was the only way of checking patches.

Since #18004, the git apply --check method has been a fallback method,
only used when the read-tree three-way merge method has detected a
conflict. The read-tree assisted three-way merge method is much faster
and less resource intensive method of detecting conflicts. #18004 kept
the git apply method around because it was thought possible that this
fallback might be able to rectify conflicts that the read-tree three-way
merge detected. I am not certain if this could ever be the case.

Given the uncertainty here and the now relative stability of the
read-tree method - this PR makes using this fallback optional but
enables it by default. A `log.Critical` has been added which will alert
if the `git apply --check` method was successful at checking a PR that
`read-tree` failed on.

The hope is that none of these log.Critical messages will be found and
there will be no significant difference in conflict detection. Thus we
will be able to remove the git apply fallback in future, and/or improve
the read-tree three-way merge method to catch any conflicts that git
apply method might have been able to fix.

An additional benefit for anyone who disables the check method is that
patch checking should be significantly less resource intensive and much
quicker.

(See
https://github.com/go-gitea/gitea/issues/22083\#issuecomment-1347961737)

Ref #22083

Signed-off-by: Andrew Thornton <art27@cantab.net>

<!--

Please check the following:

1. Make sure you are targeting the `main` branch, pull requests on
release branches are only allowed for bug fixes.
2. Read contributing guidelines:
https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md
3. Describe what your pull request does and which issue you're targeting
(if any)

-->

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2 years ago
..
advanced Add setting to disable the git apply step in test patch (#22130) (#22170) 2 years ago
developers Record OAuth client type at registration (#21316) 2 years ago
features Docs: Update the feature comparison to other Git Hosting Services (#20933) 2 years ago
help Fix the hook related FAQ contents (#21297) 2 years ago
installation Update macOS install command (#21507) 2 years ago
packages Add support for Chocolatey/NuGet v2 API (#21393) 2 years ago
translation Add markdownlint (#20512) 3 years ago
upgrade Add redirect of /upgrade/ to /upgrade-from-gitea/ on docs site (#21330) 2 years ago
usage Update reverse-proxies.zh-cn.md (#21484) 2 years ago
advanced.en-us.md
advanced.fr-fr.md
advanced.zh-cn.md
advanced.zh-tw.md [docs] Add zh-tw Translations (#14507) 4 years ago
developers.en-us.md Add Package Registry (#16510) 3 years ago
developers.zh-cn.md Add documentation for backend development (#17512) 3 years ago
developers.zh-tw.md Add Package Registry (#16510) 3 years ago
features.en-us.md
features.zh-cn.md
features.zh-tw.md
help.en-us.md
help.fr-fr.md
help.zh-cn.md
help.zh-tw.md [docs] Add zh-tw Translations (#14507) 4 years ago
installation.en-us.md
installation.fr-fr.md
installation.zh-cn.md
installation.zh-tw.md
packages.en-us.md Add Package Registry (#16510) 3 years ago
translation.de-de.md Add Package Registry (#16510) 3 years ago
translation.en-us.md Add Package Registry (#16510) 3 years ago
translation.zh-tw.md Add Package Registry (#16510) 3 years ago
upgrade.en-us.md
upgrade.fr-fr.md
upgrade.zh-cn.md
upgrade.zh-tw.md
usage.en-us.md
usage.zh-cn.md
usage.zh-tw.md [docs] Add zh-tw Translations (#14507) 4 years ago