keith / git-pile

Stacked diff support for GitHub workflows
MIT License
146 stars 11 forks source link

Onto flag not working #18

Closed bangerang closed 2 years ago

bangerang commented 2 years ago

Hi,

Thanks for putting the time into releasing this!

There seems to be some issues with the --onto option that yields unknown flag: --onto. Using latest version 0.3.0.

Steps to reproduce:

$ vim file1
$ # Make some changes...
$ git add -A
$ git commit -m 'file1'
$ vim file2
$ # Make some changes...
$ git add -A
$ git commit -m 'file2'
$ git submitpr --onto HEAD~1
unknown flag: --onto

Usage:  gh pr create [flags]

Flags:
  -a, --assignee login       Assign people by their login. Use "@me" to self-assign.
  -B, --base branch          The branch into which you want your code merged
  -b, --body string          Body for the pull request
  -F, --body-file file       Read body text from file (use "-" to read from standard input)
  -d, --draft                Mark pull request as a draft
  -f, --fill                 Do not prompt for title/body and just use commit info
  -H, --head branch          The branch that contains commits for your pull request (default: current branch)
  -l, --label name           Add labels by name
  -m, --milestone name       Add the pull request to a milestone by name
      --no-maintainer-edit   Disable maintainer's ability to modify pull request
  -p, --project name         Add the pull request to projects by name
      --recover string       Recover input from a failed run of create
  -r, --reviewer handle      Request reviews from people or teams by their handle
  -t, --title string         Title for the pull request
  -w, --web           
bangerang commented 2 years ago

On second thought, perhaps I'm misunderstanding the use of the onto flag. I was reading this as "submit a PR with all of these commits", but perhaps it is used for creating a PR with another PR as base? i.e main <- firstPR <- secondPR where the secondPR is created using the onto flag.

bangerang commented 2 years ago

Yup, I have misunderstood the use of this, sorry about that. However this flag still yields unknown flag. Will create another issue describing this.

keith commented 2 years ago

You're correct that it's for submitting chained PRs. As far as submitting a PR with multiple commits, git-pile kinda encourages single commit PRs, but in the case that isn't what you want I often make my commits on my main branch, do git submitpr FIRST_SHA, then immediately do git updatepr FIRST_SHA to add the HEAD commit to the created PR.