Skip to content

[Docs] Updated Subtree Docs for Upgrading Versions #2594

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions README.developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -1326,13 +1326,51 @@ Code included in VTR by subtrees should *not be modified within the VTR source t
Instead changes should be made in the relevant up-stream repository, and then synced into the VTR tree.

## Updating an existing Subtree

The following are instructions on how to pull in external changes from an
existing subtree. Which instructions to follow depend on if you are changing
the external ref or not.

### External Ref Does Not Change

These instructions are for if the subtree is tracking a ref of a repo which has
changes we want to pull in. For example, if the subtree is tracking main/master.

1. From the VTR root run: `./dev/external_subtrees.py $SUBTREE_NAME`, where `$SUBTREE_NAME` is the name of an existing subtree.

For example to update the `libtatum` subtree:
```shell
./dev/external_subtrees.py --update libtatum -m "commit message describing why component is being updated"
```

### External Ref Changes

These instructions are for if you want to change the ref that a subtree is
tracking. For example, if you want to change the version of a subtree (which
exists on a different branch).

1. Update `./dev/subtree_config.xml` with the new external ref.

2. Run `git log <internal_path>` and take note of any local changes to the
subtree. It is bad practice to have local changes to subtrees you cannot
modify; however, some changes must be made to allow the library to work in
VTR. The next step will clear all these changes, and they may be important
and need to be recreated.

3. Delete the subtree folder (the internal path) entirely and commit it to git.
The issue is that changing the external ref basically creates a new subtree,
so the regular way of updating the subtree does not work. You need to
completely wipe all of the code from the old subtree. NOTE: This will remove
all changes locally made to the subtree.

4. Run `./dev/external_subtrees.py --update $SUBTREE_NAME`. This will pull in
the most recent version of the subtree, squash the changes, and raise a
commit.

5. Recreate the local changes from step 2 above, such that the library builds
without issue; preferrably in a concise way such that the library can be
easily updated in the future.

## Adding a new Subtree

To add a new external subtree to VTR do the following:
Expand Down
Loading