

Who uses git-rebase before / during / after code reviews?  - lifeisstillgood

we are evaluating the range of github-a-like tools and are hitting a fairly common blindspot - a review will have (in-line) comments and they not only make up useful info for the submitter but also useful organisational knowledge - if the submitter rebases their code as part of review process, those comments can &#x2F; do get lost &#x2F; get harder to find &#x2F; vanish<p>Anyone got any similar experiences?
======
markov_twain
Github keeps the refs for pull requests separate from branches and tags. For
example, you can fetch pull request #123 into a local branch called pull-123
with: `git fetch origin refs/pull/123/head:pull-123`.

When you open a pull request from a branch, Github creates the separate pull
request refs to track changes to that branch. I'm assuming they have some kind
of after-receive hook that updates the ref whenever you push.

However, if you _close_ the pull request (or delete the branch, which
automatically closes the pull request), then rebase the branch locally and
force push your branch, the pull request will not be updated, and you still
see all the comments and historical data.

You can then open a new pull request from that branch, and go through the code
review process again. If you mention #123 in the description of the new pull
request, it'll create a link at the bottom of the discussion on the original,
closed one. This helps keep the separate discussions tied together if you're
coming back later and want to see all revisions of this branch.

