gitlab-org--gitlab-foss/app/views/projects/merge_requests
Dmitriy Zaporozhets 5ef196621e Merge branch 'better-mr-instructions' into 'master'
Better merge request manual instructions

I noticed the current instructions for manually merging a merge request that was submitted from a fork could create unnecessary merge requests or strange history. Imagine this:

1. Alice creates a repository and commits / pushes a single commit with SHA1 `A` to `master`.
2. Bob forks this repository and creates a new branch `myfeature` on `master` (`A`)
3. Alice commits `B` to `master` (which has the parent `A`)
4. Bob creates two commits on `myfeature` `P` and `Q`.
5. Bob submits the merge request to merge his `myfeature` into Alice's `master` branch.
6. Alice follows the manual merge request instructions:
  1. `git checkout -b bob/repo-myfeature master`
  2. `git pull http://... myfeature`

The branch `bob/repo-myfeature` was created from Alice's current `master`, which was `B`. When the `pull` is executed, git will fetch Bob's branch and then merged the fetched branch `Q` into the current branch's location `B`. This creates an unnecessary merge commit from `master` into the branch Alice is trying to merge. No harm is done, but the history is a bit messier.

This is even worse if Alice has set `git pull` to rebase by default. In this case, the commit `B` is rebased on top of `Q`. When Alice checks out `master` and merges in the branch, there will actually be a duplicate `B` commit.

These new instructions instead tell the user to fetch Bob's `myfeature` branch. This will fetch the necessary commits `P` and `Q` and create a temporary ref `FETCH_HEAD` pointing to `Q`. Alice will then create her local `bob/repo-myfeature` branch starting at `FETCH_HEAD`. No unnecessary merge commits, and no accidental rebasing.

See merge request !16
2014-11-10 19:39:25 +00:00
..
show Merge branch 'better-mr-instructions' into 'master' 2014-11-10 19:39:25 +00:00
_form.html.haml Merge branch 'factor-issue-mr-form-label' of https://github.com/cirosantilli/gitlabhq 2014-10-02 12:50:29 +03:00
_head.html.haml
_merge_request.html.haml Add task lists to issues and merge requests 2014-10-05 22:15:27 -05:00
_new_compare.html.haml Refactor diff suppress logic and diff views 2014-07-15 18:28:21 +03:00
_new_submit.html.haml Upgrade to Font Awesome v4.2 2014-10-03 12:19:24 +02:00
_show.html.haml Show merge in progress message if MR is locked 2014-10-15 15:52:39 +03:00
automerge.js.haml
branch_from.js.haml Add assignee/milestone block to merge request edit page. And remove branches selector from this page 2014-05-08 15:40:02 +03:00
branch_to.js.haml Show full commit info at MR form 2014-02-15 14:52:33 +02:00
diffs.html.haml
edit.html.haml A few other iids instead of ids (mostly in edit forms) 2013-10-19 09:23:51 +02:00
index.html.haml Upgrade to Font Awesome v4.2 2014-10-03 12:19:24 +02:00
invalid.html.haml alert-error to alert-danger 2013-12-31 16:34:14 +02:00
new.html.haml Refactor MR build process 2014-07-15 15:34:06 +03:00
show.html.haml
update.js.haml Allow change assignee/milestone from MergeRequest show page 2014-02-18 16:24:27 +02:00
update_branches.js.haml Fix selectbox when submit MR from fork to origin 2014-01-23 10:08:26 +02:00