info:To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Creating Patches
# Create Patches
You can manually modify an external dependency to:
...
...
@@ -8,6 +10,4 @@
It can happen that you may need to manually modify an external dependency for it
to work correctly in the context of a Omnibus embedded packaging, or even to
fix an issue that the upstream maintainer have not either accepted or still
taking longer to review and ship.
- Make sure that dependency works with Omnibus embedded packaging.
- Fix an issue that an upstream maintainer has not fixed.
...
...
@@ -13,4 +13,4 @@
## Bootstrapping
## Bootstrap patch files
Omnibus has a specific [DSL](https://github.com/chef/omnibus#software) and
...
...
@@ -15,5 +15,5 @@
Omnibus has a specific [DSL](https://github.com/chef/omnibus#software) and
conventions to ship and apply patches automatically as part of the building
conventions to ship and apply patches automatically as part of the build
process.
...
...
@@ -18,10 +18,9 @@
process.
You will store `.patch` files that contain the changes in a specific
directory structure and with the help of the `patch` DSL method, will apply
the file(s) to reflect the desired changes:
To apply patch files, store `.patch` files that contain the changes in a
specific directory structure using the `patch` DSL method:
```plaintext
config/patches/<software-name>
```
...
...
@@ -23,12 +22,12 @@
```plaintext
config/patches/<software-name>
```
As example, for a patch that will be applied during the execution of
`gitlab-rails`, you will store `.patch` files in:
For example, for a patch applied during the execution of
`gitlab-rails`, store the `.patch` files in:
```plaintext
config/patches/gitlab-rails
```
...
...
@@ -30,7 +29,12 @@
```plaintext
config/patches/gitlab-rails
```
## Creating a patch
## Create a patch
To create a patch file, you can use:
- The `diff` command to compare an original file with a modified file.
- Git to output a patch based one or more commits.
...
...
@@ -36,6 +40,3 @@
There are two easy ways to create a patch file. You can use the `diff` command
and compare a original with a modified file (i.e. `target.rb` with
`target.rb.original`) or you can use Git to output a patch based one or more
commits.
### Use `diff` to create a patch
...
...
@@ -41,3 +42,3 @@
### Diff command
To create a patch file using the `diff` command:
...
...
@@ -43,5 +44,5 @@
To create a patch file using the diff and the previous example, duplicate the
file you are changing with a new name, and make the change to the old one.
1. Duplicate the file you are changing and give the new file a new name.