Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghstack land failing with exit code 1 #233

Open
rieger-jared opened this issue Feb 14, 2024 · 1 comment
Open

ghstack land failing with exit code 1 #233

rieger-jared opened this issue Feb 14, 2024 · 1 comment

Comments

@rieger-jared
Copy link

First time user, I created a stack via ghstack which yielded this output

 ghstack
$ git remote get-url origin
$ git fetch --prune origin
$ git merge-base origin/dev HEAD
$ git rev-list --header '^af04581ebf2529de0f296a8b961e9920582c5edd' HEAD
$ git rev-list --header '^af04581ebf2529de0f296a8b961e9920582c5edd^@' af04581ebf2529de0f296a8b961e9920582c5edd
$ git rev-parse --show-toplevel
$ git config --default /Users/jared/dev/memwa/remember-backend/.git/hooks --get core.hooksPath
$ git for-each-ref refs/remotes/origin/gh/rieger-jared '--format=%(refname)'
$ git rev-parse 'cbc0ca687c9c81c55e64cbf9580c6fa8d27533e7~^{tree}'
$ git config --get commit.gpgsign
$ git commit-tree -S -p af04581ebf2529de0f296a8b961e9920582c5edd f2e1cd8aedf8c89d725e20fe0f082d4451a0d35a
$ git push origin 42b1725ddb745d733bef4163a024e9653352f632:refs/heads/gh/rieger-jared/1/head af04581ebf2529de0f296a8b961e9920582c5edd:refs/heads/gh/rieger-jare
d/1/base
To github.com:Rememba-Pty-Ltd/Rememba.git
 * [new branch]        42b1725ddb745d733bef4163a024e9653352f632 -> gh/rieger-jared/1/head
 * [new branch]        af04581ebf2529de0f296a8b961e9920582c5edd -> gh/rieger-jared/1/base
Opened PR #727
$ git commit-tree -S -p af04581ebf2529de0f296a8b961e9920582c5edd f2e1cd8aedf8c89d725e20fe0f082d4451a0d35a
$ git reset --soft b389b903da54ea646d659cbcb9d6067406e4f197
# Updating https://github.com/Rememba-Pty-Ltd/Rememba/pull/727
$ git push origin --force b389b903da54ea646d659cbcb9d6067406e4f197:refs/heads/gh/rieger-jared/1/orig
remote:
remote: Create a pull request for 'gh/rieger-jared/1/orig' on GitHub by visiting:
remote:      https://github.com/Rememba-Pty-Ltd/Rememba/pull/new/gh/rieger-jared/1/orig
remote:
To github.com:Rememba-Pty-Ltd/Rememba.git
 * [new branch]        b389b903da54ea646d659cbcb9d6067406e4f197 -> gh/rieger-jared/1/orig

# Summary of changes (ghstack 0.8.0)

 - Created https://github.com/Rememba-Pty-Ltd/Rememba/pull/727

Meta employees can import your changes by running
(on a Meta machine):

    ghimport -s https://github.com/Rememba-Pty-Ltd/Rememba/pull/727

If you want to work on this diff stack on another machine:

    ghstack checkout https://github.com/Rememba-Pty-Ltd/Rememba/pull/727
ghstack land  https://github.com/Rememba-Pty-Ltd/Rememba/pull/727
$ git fetch --prune origin
$ git merge-base origin/dev origin/gh/rieger-jared/1/orig
$ git rev-list --reverse --header '^af04581ebf2529de0f296a8b961e9920582c5edd' origin/gh/rieger-jared/1/orig
$ git symbolic-ref --short HEAD
$ git checkout origin/dev
Note: switching to 'origin/dev'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at af04581e fix get filter invited error
$ git cherry-pick origin/gh/rieger-jared/1/orig
$ git push origin origin/gh/rieger-jared/1/head:gh/rieger-jared/1/base
To github.com:Rememba-Pty-Ltd/Rememba.git
   af04581e..42b1725d  origin/gh/rieger-jared/1/head -> gh/rieger-jared/1/base
$ git push origin HEAD:refs/heads/dev
To github.com:Rememba-Pty-Ltd/Rememba.git
   af04581e..981ca0be  HEAD -> dev
$ git push origin --delete gh/rieger-jared/1/orig gh/rieger-jared/1/base gh/rieger-jared/1/head
error: unable to delete 'gh/rieger-jared/1/head': remote ref does not exist
error: failed to push some refs to 'github.com:Rememba-Pty-Ltd/Rememba.git'
$ git checkout jared/mem-767-default-share-link-on
Previous HEAD position was 981ca0be feat: default to sharing link on for new memories
Switched to branch 'jared/mem-767-default-share-link-on'
ERROR: Fatal exception
Traceback (most recent call last):
  File "/Users/jared/Library/Application Support/pipx/venvs/ghstack/lib/python3.12/site-packages/ghstack/logs.py", line 105, in manager
    yield
  File "/Users/jared/Library/Application Support/pipx/venvs/ghstack/lib/python3.12/site-packages/ghstack/cli.py", line 41, in cli_context
    yield shell, config, github
  File "/Users/jared/Library/Application Support/pipx/venvs/ghstack/lib/python3.12/site-packages/ghstack/cli.py", line 121, in land
    ghstack.land.main(
  File "/Users/jared/Library/Application Support/pipx/venvs/ghstack/lib/python3.12/site-packages/ghstack/land.py", line 181, in main
    sh.git("push", remote_name, "--delete", orig_ref, base_ref, head_ref)
  File "/Users/jared/Library/Application Support/pipx/venvs/ghstack/lib/python3.12/site-packages/ghstack/shell.py", line 277, in git
    return self._maybe_rstrip(self.sh(*(("git",) + args), **kwargs))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jared/Library/Application Support/pipx/venvs/ghstack/lib/python3.12/site-packages/ghstack/shell.py", line 213, in sh
    raise RuntimeError(
RuntimeError: git push origin --delete gh/rieger-jared/1/orig gh/rieger-jared/1/base gh/rieger-jared/1/head failed with exit code 1

Am I doing something wrong?

@ezyang
Copy link
Owner

ezyang commented Feb 14, 2024

oh this might be the thing where you have github enabling auto-deleting pr branches when they are merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants