Skip to content

Commit f5761c9

Browse files
committed
feat(applying-patch): improve some details
Signed-off-by: Simon L. <[email protected]>
1 parent a119976 commit f5761c9

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

admin_manual/issues/applying_patch.rst

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ Obtaining a patch
88
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.
99

1010
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.
11+
2. Append ``.diff`` to the URL: https://github.com/nextcloud/server/pull/26396.diff
12+
3. Download the patch to your server e.g. via ``wget https://github.com/nextcloud/server/pull/26396.diff`` (this will place ``26396.diff`` in the local directory)
13+
4. Follow the `Applying a patch`_ steps.
14+
5. If you are on an older Nextcloud version, you might first need to go to the correct backported patch for your version.
1415

1516
.. image:: images/getting-a-patch-from-github.png
1617
:alt: backportbot-nextcloud linking to the pull request for an older version.
1718

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+
6. 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 ``.diff`` URL of that backport PR.
1920

2021
Applying a patch
2122
----------------
@@ -24,32 +25,34 @@ Patching server
2425
^^^^^^^^^^^^^^^
2526

2627
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::
28+
2. Download the patch to your server e.g. via ``wget https://github.com/nextcloud/server/pull/26396.diff`` (this will place ``26396.diff`` in the local directory)
29+
3. Apply the patch with the following command::
2830

29-
patch -p 1 < /path/to/the/file.patch
31+
patch -p 1 < ./26396.diff
3032

31-
3. Alternatively, if the patch command is not available, use::
33+
4. Alternatively, if the patch command is not available, use::
3234

33-
git apply --check /path/to/the/file.diff
34-
git apply /path/to/the/file.diff
35+
git apply --check ./26396.diff
36+
git apply ./26396.diff
3537

3638
Patching apps
3739
^^^^^^^^^^^^^
3840

3941
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.
40-
2. Apply the patch with the same command as in `Patching server`_.
42+
2. Download the patch to your server e.g. via ``wget https://github.com/nextcloud/<app>/pull/26396.diff`` (this will place ``26396.diff`` in the local directory)
43+
3. Apply the patch with the same command as in `Patching server`_.
4144

4245
Reverting a patch
4346
-----------------
4447

4548
1. Navigate to the directory where you applied the patch.
4649
2. Revert the patch with the ``-R`` option::
4750

48-
patch -R -p 1 < /path/to/the/file.patch
51+
patch -R -p 1 < ./26396.diff
4952

5053
3. Alternatively, if the patch command is not available, use::
5154

52-
git apply --reverse /path/to/the/file.diff
55+
git apply --reverse ./26396.diff
5356

5457
Notes and troubleshooting
5558
-------------------------

0 commit comments

Comments
 (0)