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

gl status fails after resetting head of branch #195

Open
mfischerq opened this issue Dec 2, 2018 · 2 comments
Open

gl status fails after resetting head of branch #195

mfischerq opened this issue Dec 2, 2018 · 2 comments
Labels

Comments

@mfischerq
Copy link

I got the following error on "gl status" after I reset the head to the branch to a previous commit using "gl branch --set-head":

`On branch tmp, repo-directory //
✘ Some internal error occurred
➜ If you want to help, see http://gitless.com for info on how to report bugs and include the following information:

0.8.6

Traceback (most recent call last):
File "gitless/cli/gl.py", line 99, in main
File "gitless/cli/gl_status.py", line 45, in main
File "gitless/core.py", line 765, in status
KeyError: 513
`

Steps to reproduce:

  1. Create a new file (lets call it f.txt) in the branch and commit
  2. reset the head of the branch to a commit prior to this commit using "gl branch -sh"
  3. Contrary to my expectations, f.txt is still there and gl status shows it as tracked and "new file"
  4. Remove f.txt using the OS: "rm f.txt"
  5. "gl status" crashes

Other gl commands fail too from this point on. The only way to resolve this situation that I could find is to manually recreate the deleted file (touch f.txt).

I think there are really two issues here: the obvious that lets "gl status" crash and the "strange" behaviour of gl branch -sh. My expectation would be that resetting the head of a branch brings my workspace to a state that reflects this new head (possibly creating missing or removing non-existant files). This behaviour would be consistent to what "gl switch" does between branches.

@deeppunster
Copy link

My personal experience has been that if almost any file that git has been tracking is deleted (or moved elsewhere), gl status will generate key error 513. Attached is a zipped shell script that will reproduce the error in an empty git repository. HTH.
gl_key_error_513.sh.zip

@deeppunster
Copy link

Sorry, I forgot to note that I was using 0.8.7 of gitless as published by brew. If you need any additioonal information, please let me know. (The previous script is not commented. The attached script is the same with comments added.)
gl_key_error_513_commented.sh.zip

@spderosso spderosso added the bug label May 28, 2019
goldstar611 added a commit to goldstar611/gitless that referenced this issue Feb 21, 2022
goldstar611 added a commit to goldstar611/gitless that referenced this issue Feb 21, 2022
goldstar611 added a commit to goldstar611/gitless that referenced this issue Feb 21, 2022
goldstar611 added a commit to goldstar611/gitless that referenced this issue Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants