Skip to content

Commit 98c138e

Browse files
Merge pull request #13865 from nextcloud/jtr/admin-patching-reorg
docs(admin_manual): reorder “Patching Nextcloud” for logical flow
2 parents 8f721bb + 0932f3a commit 98c138e

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

admin_manual/issues/applying_patch.rst

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,49 @@
22
Patching Nextcloud
33
==================
44

5+
Obtaining a patch
6+
-----------------
7+
8+
If you found a related pull request on GitHub that solves your issue, or you want to help developers and verify a fix works, you can get a patch for the pull request.
9+
10+
1. Using https://github.com/nextcloud/server/pull/26396 as an example.
11+
2. Append ``.patch`` to the URL: https://github.com/nextcloud/server/pull/26396.patch
12+
3. Download the patch to your server and follow the `Applying a patch`_ steps.
13+
4. If you are on an older Nextcloud version, you might first need to go to the correct backported patch for your version.
14+
15+
.. image:: images/getting-a-patch-from-github.png
16+
:alt: backportbot-nextcloud linking to the pull request for an older version.
17+
18+
5. You can find the appropriate version by looking for a link posted by ``backportbot-nextcloud`` to the backport pull request for your release, or by checking for a developer comment with a manual backport link. Use the ``.patch`` URL of that backport PR.
19+
520
Applying a patch
621
----------------
722

823
Patching server
924
^^^^^^^^^^^^^^^
1025

11-
1. Navigate into your Nextcloud server's root directory (contains the ``status.php`` file)
12-
2. Now apply the patch with the following command::
26+
1. Navigate to your Nextcloud server's root directory (the one that contains the ``status.php`` file).
27+
2. Apply the patch with the following command::
1328

1429
patch -p 1 < /path/to/the/file.patch
1530

16-
.. note::
17-
18-
There can be errors about not found files, especially when you take a patch from GitHub there might be development or test files included in the patch. when the files are in build/ or a tests/ subdirectory it is mostly being
19-
2031
Patching apps
2132
^^^^^^^^^^^^^
2233

23-
1. Navigate to the root of this app (mostly ``apps/[APPID]/``), if you can not find the app there use the ``sudo -E -u www-data php occ app:getpath APPID`` command to find the path.
24-
2. Now apply the patch with the same command as in `Patching server`_
34+
1. Navigate to the root of the app (usually ``apps/[APPID]/``). If you cannot find the app there, use the ``sudo -E -u www-data php occ app:getpath APPID`` command to find the path.
35+
2. Apply the patch with the same command as in `Patching server`_.
2536

2637
Reverting a patch
2738
-----------------
2839

2940
1. Navigate to the directory where you applied the patch.
30-
2. Now revert the patch with the ``-R`` option::
41+
2. Revert the patch with the ``-R`` option::
3142

3243
patch -R -p 1 < /path/to/the/file.patch
3344

34-
Getting a patch from a GitHub pull request
35-
------------------------------------------
36-
37-
If you found a related pull request on GitHub that solves your issue, or you want to help developers and verify a fix works, you can get a patch for the pull request.
38-
39-
1. Using https://github.com/nextcloud/server/pull/26396 as an example.
40-
2. Append ``.patch`` to the URL: https://github.com/nextcloud/server/pull/26396.patch
41-
3. Download the patch to your server and follow the `Applying a patch`_ steps.
42-
4. In case you are on an older version, you might first need to go the the correct version of the patch.
45+
Notes and troubleshooting
46+
-------------------------
4347

44-
.. image:: images/getting-a-patch-from-github.png
45-
:alt: backportbot-nextcloud linking to the pull request for an older version.
48+
.. note::
4649

47-
5. You can find it by looking for a link by the ``backportbot-nextcloud`` or a developer will leave a manual comment about the backport to an older Nextcloud version. For the example above you the pull request for Nextcloud 21 is at https://github.com/nextcloud/server/pull/26406 and the patch at https://github.com/nextcloud/server/pull/26406.patch
50+
You may see errors about files not being found, especially when applying patches from GitHub. Patches can include development or test files (for example, files under ``build/`` or ``tests/``) that are not present on your installation. These messages are expected and can be ignored if they refer only to such files.

0 commit comments

Comments
 (0)