Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[upstream_utils] Document adding a patch (NFC) #5432

Merged
44 changes: 43 additions & 1 deletion upstream_utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Move the patch files to `upstream_utils`.
mv *.patch allwpilib/upstream_utils/lib_patches
```

Navigate back to `upstream_utils`
Navigate back to `upstream_utils`.
```bash
cd allwpilib/upstream_utils
```
Expand All @@ -64,3 +64,45 @@ Modify the version number in the call to `setup_upstream_repo()` in
```bash
./update_lib.py
```

## Adding patch to thirdparty library

The example below will add a new patch file to a hypothetical library called
`lib`.
calcmogul marked this conversation as resolved.
Show resolved Hide resolved

Start in the `upstream_utils` folder. Restore the original repo.
```bash
./update_lib.py
calcmogul marked this conversation as resolved.
Show resolved Hide resolved
```

Navigate to the repo.
```bash
cd /tmp/lib
calcmogul marked this conversation as resolved.
Show resolved Hide resolved
```

Make a commit with the desired changes.
```bash
git add ...
git commit -m "..."
```

Generate patch files.
```bash
git format-patch 2.0..HEAD --zero-commit --abbrev=40 --no-signature
```
where `2.0` is replaced with the version specified in `update_lib.py`.
calcmogul marked this conversation as resolved.
Show resolved Hide resolved

Move the patch files to `upstream_utils`.
```
mv *.patch allwpilib/upstream_utils/lib_patches
calcmogul marked this conversation as resolved.
Show resolved Hide resolved
```

Navigate back to `upstream_utils`.
```bash
cd allwpilib/upstream_utils
```

Rerun `update_lib.py` to reimport the thirdparty files.
calcmogul marked this conversation as resolved.
Show resolved Hide resolved
```bash
./update_lib.py
calcmogul marked this conversation as resolved.
Show resolved Hide resolved
```