forgejo/docs/content/doc/advanced
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>
2022-12-22 11:59:10 +01:00
..
adding-legal-pages.en-us.md Fix various typos of software names (#18083) 2021-12-24 11:56:57 +08:00
clone-filter.en-us.md Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00
cmd-embedded.en-us.md Fix various typos of software names (#18083) 2021-12-24 11:56:57 +08:00
config-cheat-sheet.en-us.md Add setting to disable the git apply step in test patch (#22130) (#22170) 2022-12-22 11:59:10 +01:00
config-cheat-sheet.zh-cn.md Clarify that ENABLE_SWAGGER only influences the API docs, not the routes (#21215) 2022-09-20 00:48:48 +02:00
customizing-gitea.en-us.md Fix PlantUML example in document (#21142) 2022-09-11 22:14:46 +08:00
customizing-gitea.zh-cn.md Update documentation to reflect #15219 (#16442) 2021-07-15 20:49:12 +01:00
environment-variables.en-us.md Update docs and comments to remove macaron (#14491) 2021-01-29 16:35:30 +01:00
environment-variables.zh-cn.md Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00
external-renderers.en-us.md Add KaTeX rendering to Markdown. (#20571) 2022-09-14 00:33:37 +08:00
hacking-on-gitea.zh-cn.md ZH-CN translation of Advanced part (#5090) 2018-10-17 14:21:20 +03:00
logging-documentation.en-us.md Upgrade the document about how to collect logs for systemd and docker (#21101) 2022-09-07 23:58:55 +08:00
mail-templates-us.md Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00
make.fr-fr.md docs: fix various typos and translate to french (#16477) 2021-07-18 12:21:32 -04:00
make.zh-cn.md Reformat docs (#13897) 2020-12-09 07:47:06 +01:00
protected-tags.en-us.md Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00
repo-indexer.en-us.md Reformat docs (#13897) 2020-12-09 07:47:06 +01:00
repo-mirror.en-us.md Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00
search-engines-indexation.en-us.md Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00
signing.en-us.md Add hint to GNUPGHOME environment variable (#20134) 2022-07-10 17:04:46 +08:00
third-party-tools.zh-cn.md Add markdownlint (#20512) 2022-07-28 09:22:47 +08:00