gg-scm / gg

Git with less typing
https://gg-scm.io
Apache License 2.0
65 stars 1 forks source link

evolve should handle merged pull request branches #73

Open zombiezen opened 6 years ago

zombiezen commented 6 years ago

Steps to Reproduce

# On an existing working copy in the fork/pull workflow:
$ gg branch feature
$ gg commit -m "Made a change"
$ gg push -create
$ gg requestpull
# Pull request is merged, squashed and merged, or rebased.
$ gg pull
$ gg evolve

Expected Behavior

evolve consults the GitHub pull request API to see if the branch corresponding to the pull request was merged, and then advances the ref to the merge_commit_sha if present locally.

Actual Behavior

Nothing happens.

zombiezen commented 5 years ago

Don't have a full idea yet, but in doing some absent-minded sketching, a GraphQL query like this might be useful for finding relevant PRs in a project.

query ($repoOwner: String!, $repo: String!, $tok: String, $headRef: String) {
  repository(owner: $repoOwner, name: $repo) {
    pullRequests(after: $tok, first: 100, headRefName: $headRef, states: [MERGED]) {
      nodes {
        number
        headRepositoryOwner {
          login
        }
        headRefName
        headRefOid
        mergeCommit {
          oid
        }
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}