-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
"You're not inside a cpython repo right now! π " says cherry_picker when I'm in my cpython git repo #99
Comments
Are you using Git worktrees? Maybe it doesn't know how to checkout branches already checked out in other directories. If so, does it work when you cd to the 3.12 worktree dir first? |
See the swallowed ValueError at the bottom. it was leftover cherry-picker state from some earlier forcably abandoned run due to whatever other things i was hitting. |
I use version 2.2.0 cherry_picker and git version 2.39.3 (Apple Git-145). After I run Β» cherry_picker --continue
π π β
Traceback (most recent call last):
File "/opt/homebrew/bin/cherry_picker", line 8, in <module>
sys.exit(cherry_pick_cli())
^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/cherry_picker/cherry_picker.py", line 802, in cherry_pick_cli
cherry_picker.continue_cherry_pick()
File "/opt/homebrew/lib/python3.11/site-packages/cherry_picker/cherry_picker.py", line 591, in continue_cherry_pick
commits = get_commits_from_backport_branch(base)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/cherry_picker/cherry_picker.py", line 902, in get_commits_from_backport_branch
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'log', '--format=%H', '3.11..']' returned non-zero exit status 128. |
@dpr-0, try to look to the |
I have removed it and re-run cherry_picker but I still get subprocess.CalledProcessError like above. |
I had a similar error, since the |
I suggest we remove the "You're not inside a cpython repo right now! π " handling and let the original exception and message bubble up and be displayed. |
This worked for me. Shouldn't |
I got this error and now I cannot get it to go away. Tried adding the remote tracking branches which didn't help. Tried completely removing the backport branch and starting over, still get the error. π |
remove cherry-picker state in |
I ran into this issue today also. I'd run cherry_picker, then resolved a conflict, then mistakenly committed the change. From there, I tried to
I was able to bypass the error by manually cleaning up the .git/config. |
I ran into this issue also, but the workaround didn't work for me. I was in the middle of a cherry pick, so couldn't switch to 3.11. I couldn't |
I ran into this issue just now. #119 at least provides more info:
|
This worked for me to suppress the error, but this workaround should be mentioned somewhere in the error message. |
Just ran into this the exact same way that @jaraco did: resolving a conflict and committing the result. It's really easy to do when using VSCode, since the conflict resolution UI in there just naturally leads into committing when you've resolved everything. |
I ran into this issue also. I'm working on my forked cpython repo, but I faced same error message even I'm already added upstream as a remote. Thanks @aloisklink the |
I just ran into the same thing with cherry picker 2.3.0. I can confirm that the solutions to remove cherry picker-related config from |
When I played with cherry-picker as we introduced it in Airflow, I manage to set the repo to the state where I always got the message "You're not inside a airflow repo right now!" After short debugging it turned out that it is because I manage to Ctrl-C and mix `git cherry-pick --abort` with `cherry_picker` commands - when I learned how to use it, I did not know that I had to only use `cherry-picker --continue` command rather than git commands. This might happen to others, so I think we should have a better way to handle this case. When this happens you get this exception: ``` Traceback (most recent call last): File "/Users/jarek/IdeaProjects/cherry-picker/cherry_picker/cherry_picker.py", line 666, in check_repo self.get_state_and_verify() File "/Users/jarek/IdeaProjects/cherry-picker/cherry_picker/cherry_picker.py", line 684, in get_state_and_verify raise ValueError( ValueError: Run state cherry-picker.state=BACKPORT_LOOP_START in Git config is not known. Perhaps it has been set by a newer version of cherry-picker. Try upgrading. Valid states are: BACKPORT_PAUSED, UNSET. If this looks suspicious, raise an issue at https://github.com/python/cherry-picker/issues/new. As the last resort you can reset the runtime state stored in Git config using the following command: `git config --local --remove-section cherry-picker` During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/jarek/.local/bin/cherry_picker", line 8, in <module> sys.exit(cherry_pick_cli()) ^^^^^^^^^^^^^^^^^ File "/Users/jarek/.local/share/uv/tools/cherry-picker/lib/python3.12/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jarek/.local/share/uv/tools/cherry-picker/lib/python3.12/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Users/jarek/.local/share/uv/tools/cherry-picker/lib/python3.12/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jarek/.local/share/uv/tools/cherry-picker/lib/python3.12/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jarek/.local/share/uv/tools/cherry-picker/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jarek/IdeaProjects/cherry-picker/cherry_picker/cherry_picker.py", line 804, in cherry_pick_cli cherry_picker = CherryPicker( ^^^^^^^^^^^^^ File "/Users/jarek/IdeaProjects/cherry-picker/cherry_picker/cherry_picker.py", line 123, in __init__ self.check_repo() # may raise InvalidRepoException ^^^^^^^^^^^^^^^^^ File "/Users/jarek/IdeaProjects/cherry-picker/cherry_picker/cherry_picker.py", line 668, in check_repo raise InvalidRepoException(ve.args[0]) cherry_picker.cherry_picker.InvalidRepoException: Run state cherry-picker.state=BACKPORT_LOOP_START in Git config is not known. Perhaps it has been set by a newer version of cherry-picker. Try upgrading. Valid states are: BACKPORT_PAUSED, UNSET. If this looks suspicious, raise an issue at https://github.com/python/cherry-picker/issues/new. As the last resort you can reset the runtime state stored in Git config using the following command: `git config --local --remove-section cherry-picker` ``` So this PR checks for presence of that message in the exception and it will provide better explanation, and guidance in this case. Fixes: python#99
When I played with cherry-picker as we introduced it in Airflow, I manage to set the repo to the state where I always got the message "You're not inside a airflow repo right now!" After short debugging it turned out that it is because I manage to Ctrl-C and mix `git cherry-pick --abort` with `cherry_picker` commands - when I learned how to use it, I did not know that I had to only use `cherry-picker --continue` command rather than git commands. This might happen to others, so I think we should have a better way to handle this case. When this happens you get this exception: ``` Traceback (most recent call last): File "/Users/jarek/IdeaProjects/cherry-picker/cherry_picker/cherry_picker.py", line 666, in check_repo self.get_state_and_verify() File "/Users/jarek/IdeaProjects/cherry-picker/cherry_picker/cherry_picker.py", line 684, in get_state_and_verify raise ValueError( ValueError: Run state cherry-picker.state=BACKPORT_LOOP_START in Git config is not known. Perhaps it has been set by a newer version of cherry-picker. Try upgrading. Valid states are: BACKPORT_PAUSED, UNSET. If this looks suspicious, raise an issue at https://github.com/python/cherry-picker/issues/new. As the last resort you can reset the runtime state stored in Git config using the following command: `git config --local --remove-section cherry-picker` During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/jarek/.local/bin/cherry_picker", line 8, in <module> sys.exit(cherry_pick_cli()) ^^^^^^^^^^^^^^^^^ File "/Users/jarek/.local/share/uv/tools/cherry-picker/lib/python3.12/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jarek/.local/share/uv/tools/cherry-picker/lib/python3.12/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Users/jarek/.local/share/uv/tools/cherry-picker/lib/python3.12/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jarek/.local/share/uv/tools/cherry-picker/lib/python3.12/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jarek/.local/share/uv/tools/cherry-picker/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jarek/IdeaProjects/cherry-picker/cherry_picker/cherry_picker.py", line 804, in cherry_pick_cli cherry_picker = CherryPicker( ^^^^^^^^^^^^^ File "/Users/jarek/IdeaProjects/cherry-picker/cherry_picker/cherry_picker.py", line 123, in __init__ self.check_repo() # may raise InvalidRepoException ^^^^^^^^^^^^^^^^^ File "/Users/jarek/IdeaProjects/cherry-picker/cherry_picker/cherry_picker.py", line 668, in check_repo raise InvalidRepoException(ve.args[0]) cherry_picker.cherry_picker.InvalidRepoException: Run state cherry-picker.state=BACKPORT_LOOP_START in Git config is not known. Perhaps it has been set by a newer version of cherry-picker. Try upgrading. Valid states are: BACKPORT_PAUSED, UNSET. If this looks suspicious, raise an issue at https://github.com/python/cherry-picker/issues/new. As the last resort you can reset the runtime state stored in Git config using the following command: `git config --local --remove-section cherry-picker` ``` So this PR checks for presence of that message in the exception and it will provide better explanation, and guidance in this case. Fixes: python#99
Same here - I jus tnoticed it after creating #147 - may the better PR wins π : |
It appears that some validation logic was added that doesn't take actual git clone configurations into account.
That logic appears to have been there "forever" (5 years per Blame) but there was a recent change a month-ish ago to the b471da1 that added a
get_state_and_verify()
call tocheck_repo()
. Related?The other issue aside from the bug is that the error message is inaccurate and thus unhelpful - It does not provide full details on exactly what it thinks is amiss in the state is detected vs exactly what state expects so I can't tell anything about the nature of the bug or if there's something simple I could do given I am within a git clone of cpython with many remote repos and branches that I've been using for years.
Getting overly creative with pdb, the error message that was suppressed was apparently:
The text was updated successfully, but these errors were encountered: