Extension:GuidedTour/Upstream change

From mediawiki.org

This is the process if you want to send a change through Gerrit to the dev branch of upstream Guiders:

As a one-time thing, do:

  1. git remote add jeff-optimizely git://github.com/jeff-optimizely/Guiders-JS.git
    
  2. Clone the uptream Guiders repo on GitHub, so you have https://github.com/username/Guiders-JS
  3. Add this to your local repo:
    git remote add username git@github.com:username/Guiders-JS.git
    
    That will let you fetch upstream from GitHub, and (later, after Gerrit review) do pull requests.

Then, for each new change you want in upstream:

  1. Get the latest from upstream to your local repo.
    git fetch jeff-optimizely
    
  2. Start a local branch for your change. Use the naming convention pull_request_<appropriate_desciption>.
    git checkout jeff-optimizely/dev -b pull_request_some_description
    
  3. Before actually doing anything, push this branch to Gerrit without review:
    git push origin $(git rev-parse --abbrev-ref HEAD)
    
  4. Do your commits as normal. If it doesn't generate a Change-Id, do:
    cp other_repo/.git/hooks/commit-msg .git/modules/externals/mediawiki.libs.guiders/mediawiki.libs.guiders.submodule/hooks/
    
    then do:
    git commit --amend
    
  5. When you have progress you want reviewed on Gerrit:
    git push origin HEAD:refs/for/$(git rev-parse --abbrev-ref HEAD)
    

Once your change passes review, it will automatically get mirrored to our GitHub. Until then, the branch will still be there, but with only the upstream code. When the Gerrit change is approved:

  1. Checkout the branch
  2. Send it to your GitHub fork:
    git push username $(git rev-parse --abbrev-ref HEAD)
    
  3. Use the GitHub.com interface to send pull_request_some_description as a pull request to upstream.