Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Please, make sure to create a "Pull Request" from a branch and NOT from your "master". (You'll understand exactly why after reading #2)
  2. Be warned that any additional changes/commits you make to that branch (before the "Pull Request" is accepted/merged) will immediately be included in that existing "Pull Request". This means that, if you want to continue your local development, you must create that "Pull Request" from a semi-static branch (so that any additional commits you make on "master" in the meantime don't get included as part of the existing "Pull Request").
    • The reason why this occurs is that a "Pull Request" just points at a specific "branch" (the branch it was initialized from). It does NOT point at a specific set of commits. So, when the "Pull Request" is accepted/merged, you are pulling in the latest version of that "branch". For more information, closely read the GitHub help page on Pull Requests, specifically noting the following statement:

      Pull requests can be sent from any branch or commit but it’s recommended that a topic branch be used so that follow-up commits can be pushed to update the pull request if necessary.

  3. Once your "Pull Request" is created, you can use the GitHub Pull Request tools to communicate with the Committer who is assigned to the Pull Request. If further changes are requested, you can make those changes on the branch where you initiated the Pull Request (and those changes will automatically become part of the Pull Request, as described above)

Recommended setup of repositories for

...

committers

As a commitercommitter, to be able to push to the official DSpace/DSpace repository, you need to have your public ssh key added to your GitHub account. To do that, go to Account settings -> SSH Keys. You can add multiple ssh keys (useful if you use multiple machines).

...

Code Block
# make sure you have forked the DSpace/DSpace repo on GitHub
git clone git@github.com:YourName/DSpace.git
cd DSpace
git remote add upstream git@github.com:DSpace/DSpace.git
git fetch upstream
# now "git remote show" should look like this:
origin
upstream

For more information, and a sample git workflow, see  Developing from a Forked Repository section above.

Getting a commit to multiple branches (backporting)

This will be explained on the example of getting a bugfix to both:

  • to the "master" branch (in order for it to appear in the next major DSpace release)
  • to the release branch, e.g. "dspace-3_x" (in order for it to appear in the next minor DSpace release)
Option 1 - two separate Pull Requests

Create two separate pull requests, one for the master branch, one for the release branch.

Option 2 - "cherry-pick" changes from master to release branch

The terminology used here will assume the setup described in Recommended setup of repositories for commiters.

  1. First, make sure you have

...

  1. the release branch (e.g. 'dspace-3_x

...

  1. ') set up correctly in your local repo. It needs to be setup to "track" the branch in the "upstream" repo

    Code Block
    # run one time only, to get the branch to your local repo.
    git checkout --track -b dspace-3_x upstream/dspace-3_x

...

  1. Create a pull request Pull Request for the "master" branch. The easiest way to do this is to create it via GitHub.
  2. After it your Pull Request has been reviewed and approved, pull the pull request to make it appear as 2 commits in the master branch - the sure it is merged into the "master" branch.  The merger will result in two separate commits - the original change itself and the merge commit. Make sure you know the hash of the original commit.
  3. Use git cherry-pick to add the original commit to the release branch:
Code Block
# Make sure you are on your release branch (e.g. dspace-3_x)
git checkout dspace-3_x
# If you just merged to upstream/master), fetch the list of latest revisions from the upstream repo. not needed if you have the commit anywhere in the local repo.
git fetch upstream
# thisThis is the hash of the original commit:
git cherry-pick abc123def456
# check that it's correct:
git log
# Finally, push from your local repo to the upstream repo branch
git push upstream dspace-3_x

...