#
Branching
#
Overview
Before You Read
Before you change anything in the vehicle codebase, it is important that you do one thing: branch. I'd recommend that you consult the Git Basics section of the wiki for a git tutorial/refresher if needed.
What branching ensures in our system is compartmentalization of changes across multiple developers. In our vehicle codebase, there is a lot going on, and multiple ROS nodes depend on multiple other nodes in order to function.
Say there is work required on a node called object_detection
. Our work with object_avoidance
may depend on the earlier version of object_detection
. If
object_detection
is not fully functioning during its retooling, object_avoidance
is not going to be developed further until that is done, and we can't have that.
In comes branches. Branches separate changes so that you can't break everyones code by yourself, only yours.
To manage all this, we will be using the Git Feature Branch Workflow.
#
Creating Branches
Branching Responsibilities
Feel free to create your own branch by following these instructions, or ask a lead to do it for you
Create a new branch off of
dev
that describes your software. Should be prepended with "feature-" (i.e., "feature-2d-sign-detector"), and should be named in a similar fashion to the milestone for clarity. You can create a new branch by either:-
- On the main project page, next to where it displays the current branch in a dropdown, press the "+" icon,
then select "New branch." On the next page, make sure you select
dev
for "create from"
- On the main project page, next to where it displays the current branch in a dropdown, press the "+" icon,
then select "New branch." On the next page, make sure you select
-
- With a local checkout of the repository, first make sure you are on a recent version of the dev branch:
git checkout dev; git pull
Then create a new branch:
git checkout -b feature-your-feature-name-here
-
Immediately create a merge request to merge this feature branch back into dev. Make sure to prepend "WIP:" to the issue title so that it's known that the software is not yet done
#
For Active Developers
Checkout Your Branch Run
git checkout {feature-branch}
on the branch associated with your milestone.Develop software on your branch. Commit early and often (See Git Basics. Run automated testing pipelines if available.
Once software is ready to merge, remove WIP tag. Notify team lead that software is ready to merge (once automatic testing is enabled, must wait until automatic testing passes).