Skip to content

Workflow

Derek Bruening edited this page Nov 29, 2014 · 6 revisions

Dr. Memory Development Workflow

We use a centralized rebase workflow. We have a central repository with a single branch "master" and a linear history. Developers work in local topical branches but commit them to the "master" branch on the central repository.

No local changes should be made to the local "master" branch: all changes should occur on a topical branch. For simplicity, pulls and pushes are done directly on the topical branch, so normally the local "master" branch is rarely used.

Checking out the code

Clone the repository, either via ssh if you've set up ssh keys in your Github profile:

git clone [email protected]:DynamoRIO/drmemory.git

Or via https:

git clone https://github.com/DynamoRIO/drmemory.git

Now run the development setup script:

make/git/devsetup.sh

Working on a feature

Ensure origin is up to date:

git fetch origin

Then create a new branch for the feature or project, called a "topical" branch. Replace "topical" here with a name of your choice:

git checkout --track -b topical origin/master

If you've run the development setup script, you can shorten this to:

git newbranch topical

Now perform your work in the topical branch, committing locally.

Merging upstream changes

To bring upstream changes into your local topical branch:

git pull --rebase
git submodule update

If you've run the development setup script, you don't need the --rebase argument, and you can use the alias pullall to perform both steps at once:

git pullall

Pushing local changes upstream

Once the code in your topical branch has been reviewed, passed the test suite, and is ready to commit upstream, you can push it by running this command while on the topical branch:

git push origin HEAD:master

If you've run the development setup script, you can shorten this to:

git dcommit

Deleting a topical branch

Once you've pushed your changes upstream, you can delete your topical branch with these commands (substituting your branch's name for "topical"):

git checkout master
git pull --rebase
git branch -d topical

Submodule rollback

Be careful with submodules when pulling upstream changes. If a submodule was modified upstream and only a git pull is run without a subsequent git submodule update, that upstream change will be reverted upon the next git push. Please use the pullall alias as described below to avoid accidentally clobbering submodule changes.

We do have a pre-commit hook in place that will warn you if you try to roll back the dynamorio submodule while checking in at least one other file:

% git commit -a
Error: the dynamorio submodule is being rolled back.
This is likely a mistake: did you pull but not run git submodule update?
Aborting commit.

Updating DynamoRIO

Run git checkout <hash> to update DynamoRIO to that hash:

cd dynamorio
git checkout 0c81acfc9aaea949e6f6ecfe0b4157c06a014dda

For more details, see UpdatingDR.

Clone this wiki locally