Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

amending PR branches via force-push causes unreachable commits to vanish from web UI #998

Open
@aspiers

Description

@aspiers

When you want to amend a pull request, you have a choice of two ways to do it:

  1. Push new commits on top of the head of the existing PR branch
  2. Force-push (git push -f) a new head to the PR branch, thereby rewriting history.

Unfortunately currently both have significant problems, as explained in this issue's sibling #997.

This issue is for tracking just one of the problems with the second (force-push) approach: amending PR branches via force-push causes unreachable commits to vanish from the web UI. (#997 and #999 document other, separate problems with this approach.)

This is in stark contrast to Gerrit which preserves every version of a patch set for every review.

For a concrete example, see aspiers/test#3. At some point I force-pushed a commit with SHA1 bdb 4c22 (space inserted to avoid accidental pinning which would break the garbage-collection experiment in #997). Now that SHA1 is no longer linked from aspiers/test#3 (other than from my manually constructed and deliberately obfuscated hyperlink).

There is a workaround but it is far from convenient: assuming the commits you are interested in have not been garbage-collected as a result of #997, you can use GitHub's API to walk the PR branch's "reflog" equivalent and recover commits from that.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions