| name | upstream-patches |
| description | Working with upstream patches - creating, editing, deleting, and rebasing patches for the Terraform provider submodule in the upstream/ directory |
| user-invocable | false |
Working with Upstream Patches
The upstream/ directory is a git submodule pointing to the upstream Terraform provider. We maintain patches in the patches/ directory that are applied on top of the upstream code. Use ./scripts/upstream.sh to manage patches.
Commands Reference
| Command | Description |
|---|
./scripts/upstream.sh init | Initialize upstream and apply patches to working directory |
./scripts/upstream.sh init -f | Force re-initialize, discarding any changes |
./scripts/upstream.sh checkout | Create branch with patches as commits for editing |
./scripts/upstream.sh rebase -i | Interactively edit patch commits |
./scripts/upstream.sh rebase -o <commit> | Rebase patches onto a new upstream commit |
./scripts/upstream.sh check_in | Write commits back to patches and exit checkout mode |
Creating a New Patch
./scripts/upstream.sh checkout
cd upstream
git commit -am "Description of the change"
cd ..
./scripts/upstream.sh check_in
Deleting a Patch
./scripts/upstream.sh checkout
./scripts/upstream.sh rebase -i
./scripts/upstream.sh check_in
Editing an Existing Patch
./scripts/upstream.sh checkout
./scripts/upstream.sh rebase -i
git commit --amend
git rebase --continue
./scripts/upstream.sh check_in
Rebasing Patches to a New Upstream Version
./scripts/upstream.sh checkout
./scripts/upstream.sh rebase -o <new_commit_sha>
./scripts/upstream.sh check_in
Reviewing Patches
Patches are stored in patches/ as numbered .patch files:
0001-Description.patch
0002-Another-change.patch
To understand what a patch does:
- Read the patch file directly - it's a standard git diff format
- Or enter checkout mode and use
git log to see commits
Important Notes
- Never commit directly to
upstream/ - Always use the checkout/check_in workflow
- Patches are applied in order - Numbering matters
- After
check_in, both patches/ and upstream changes are staged
- If checkout mode is stuck, use
./scripts/upstream.sh init -f to reset