@@ -1326,13 +1326,51 @@ Code included in VTR by subtrees should *not be modified within the VTR source t
1326
1326
Instead changes should be made in the relevant up-stream repository, and then synced into the VTR tree.
1327
1327
1328
1328
# # Updating an existing Subtree
1329
+
1330
+ The following are instructions on how to pull in external changes from an
1331
+ existing subtree. Which instructions to follow depend on if you are changing
1332
+ the external ref or not.
1333
+
1334
+ # ## External Ref Does Not Change
1335
+
1336
+ These instructions are for if the subtree is tracking a ref of a repo which has
1337
+ changes we want to pull in. For example, if the subtree is tracking main/master.
1338
+
1329
1339
1. From the VTR root run: ` ./dev/external_subtrees.py $SUBTREE_NAME ` , where ` $SUBTREE_NAME ` is the name of an existing subtree.
1330
1340
1331
1341
For example to update the ` libtatum` subtree:
1332
1342
` ` ` shell
1333
1343
./dev/external_subtrees.py --update libtatum -m " commit message describing why component is being updated"
1334
1344
` ` `
1335
1345
1346
+ # ## External Ref Changes
1347
+
1348
+ These instructions are for if you want to change the ref that a subtree is
1349
+ tracking. For example, if you want to change the version of a subtree (which
1350
+ exists on a different branch).
1351
+
1352
+ 1. Update ` ./dev/subtree_config.xml` with the new external ref.
1353
+
1354
+ 2. Run ` git log < internal_path> ` and take note of any local changes to the
1355
+ subtree. It is bad practice to have local changes to subtrees you cannot
1356
+ modify; however, some changes must be made to allow the library to work in
1357
+ VTR. The next step will clear all these changes, and they may be important
1358
+ and need to be recreated.
1359
+
1360
+ 3. Delete the subtree folder (the internal path) entirely and commit it to git.
1361
+ The issue is that changing the external ref basically creates a new subtree,
1362
+ so the regular way of updating the subtree does not work. You need to
1363
+ completely wipe all of the code from the old subtree. NOTE: This will remove
1364
+ all changes locally made to the subtree.
1365
+
1366
+ 4. Run ` ./dev/external_subtrees.py --update $SUBTREE_NAME ` . This will pull in
1367
+ the most recent version of the subtree, squash the changes, and raise a
1368
+ commit.
1369
+
1370
+ 5. Recreate the local changes from step 2 above, such that the library builds
1371
+ without issue; preferrably in a concise way such that the library can be
1372
+ easily updated in the future.
1373
+
1336
1374
# # Adding a new Subtree
1337
1375
1338
1376
To add a new external subtree to VTR do the following:
0 commit comments