Create Patches contribute
You can manually modify an external dependency to:
- Make sure that dependency works with Omnibus embedded packaging.
- Fix an issue that an upstream maintainer has not fixed.
Bootstrap patch files
Omnibus has a specific DSL and conventions to ship and apply patches automatically as part of the build process.
To apply patch files, store .patch
files that contain the changes in a
specific directory structure using the patch
DSL method:
config/patches/<software-name>
For example, for a patch applied during the execution of
gitlab-rails
, store the .patch
files in:
config/patches/gitlab-rails
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.
Use diff
to create a patch
To create a patch file using the diff
command:
- Duplicate the file you are changing and give the new file a new name.
- Change the original file.
diff -Naur <original_file> <new_file> > <patch_filename>.patch
Use Git to create a patch
Use the git diff
command to create a patch file between two Git commits.
You must know both commit IDs.
git diff <commitid1> <commitid2> > <patch_filename>.patch
You can also create a patch file based on one Git commit and the base HEAD.
git diff <commitid1> > <patch_filename>.patch
Use the patch
To patch one or more files:
-
Get the original files by downloading, bundle installing, or using a similar method.
-
Add the following line to each original file:
patch source: '<patch_filename>.patch', target: "#{<install_directory>}/embedded/<target_file>.txt"
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support