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

list index out of range when running git-sim rebase main #6

Closed
jwsloan opened this issue Jan 23, 2023 · 10 comments
Closed

list index out of range when running git-sim rebase main #6

jwsloan opened this issue Jan 23, 2023 · 10 comments

Comments

@jwsloan
Copy link

jwsloan commented Jan 23, 2023

This project is a cool idea! I thought it might help folks understand and feel more comfortable with a rebase.

Unfortunately, I get this error when trying to rebase my branch against the main branch:

site-packages/git_sim/git_sim_rebase.py", line 48, in execute
    current = self.commits[i]
IndexError: list index out of range
@pindab0ter
Copy link

I'm having the same issue.

When using git-sim merge develop everything works fine. When trying git-sim rebase develop I get this error:

Traceback (most recent call last):
  File "/opt/homebrew/bin/git-sim", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.10/site-packages/git_sim/__main__.py", line 89, in main
    scene.render()
  File "/opt/homebrew/lib/python3.10/site-packages/manim/scene/scene.py", line 223, in render
    self.construct()
  File "/opt/homebrew/lib/python3.10/site-packages/git_sim/git_sim.py", line 56, in construct
    self.command.execute()
  File "/opt/homebrew/lib/python3.10/site-packages/git_sim/git_sim_rebase.py", line 48, in execute
    current = self.commits[i]
IndexError: list index out of range

I tried this on Apple Silicon, on a fresh installation as of 2023-01-23.

@initialcommit-io
Copy link
Contributor

Thanks for reporting this @jwsloan and @pindab0ter.

Can either of you run $ git log --all --graph and attach a screenshot so I can see the structure that you're trying to rebase?

@pindab0ter
Copy link

Unfortunately, I can't seem to replicate it right now. As soon as it happens again in a project I can share the log of, I will.

@jwsloan
Copy link
Author

jwsloan commented Jan 24, 2023

I'm still seeing the same issue with the same branch on my Apple Silicon machine, but there is way too much coming up in that log for me to share it here.
Is there any way I can help without providing all of that git log info?

@initialcommit-io
Copy link
Contributor

initialcommit-io commented Jan 24, 2023 via email

@initialcommit-io
Copy link
Contributor

@jwsloan Sorry about the gibberish in my last message, I tried responding via email. Actually I think there is a better way to run the git log command to prune down the output to the 2 specific branches in question.

Can you try this:

$ git log --graph branch1 branch2

That should show the commit graph but only for the 2 branches in question - the branch that you a rebasing and the one you're moving it to.

@fbrinker
Copy link

fbrinker commented Jan 25, 2023

I have similar issues with a ~15 year old repository in our company. git-sim log works, but rebasing or merging with the master branch does not.

 ✘  ~/development/...  git-sim merge master
Simulating: git merge master
Traceback (most recent call last):
  File "/usr/bin/git-sim", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/git_sim/__main__.py", line 89, in main
    scene.render()
  File "/usr/lib/python3.10/site-packages/manim/scene/scene.py", line 223, in render
    self.construct()
  File "/usr/lib/python3.10/site-packages/git_sim/git_sim.py", line 56, in construct
    self.command.execute()
  File "/usr/lib/python3.10/site-packages/git_sim/git_sim_merge.py", line 67, in execute
    self.draw_arrow_between_commits("abcdef", self.commits[0].hexsha)
  File "/usr/lib/python3.10/site-packages/git_sim/git_sim_base_command.py", line 486, in draw_arrow_between_commits
    end = self.drawnCommits[endsha].get_center()
KeyError: '3df5529906c8a70b3e70ad2da16e69952fc72c86'



 ✘  ~/development/...  git-sim rebase master
Simulating: git rebase master
Traceback (most recent call last):
  File "/usr/bin/git-sim", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/git_sim/__main__.py", line 89, in main
    scene.render()
  File "/usr/lib/python3.10/site-packages/manim/scene/scene.py", line 223, in render
    self.construct()
  File "/usr/lib/python3.10/site-packages/git_sim/git_sim.py", line 56, in construct
    self.command.execute()
  File "/usr/lib/python3.10/site-packages/git_sim/git_sim_rebase.py", line 53, in execute
    self.draw_arrow_between_commits(tr.hexsha, parent)
  File "/usr/lib/python3.10/site-packages/git_sim/git_sim_base_command.py", line 485, in draw_arrow_between_commits
    start = self.drawnCommits[startsha].get_center()
KeyError: 'a77f16ff7baa42e6aa79ecc6c9e49e568bf1bbdf'

I can't really provide a helpful git log graph due to its size and contents, since many information are confidential.
Top/Left is branch 1: https://ibb.co/9ckzWs9
And I can scroll that list down forever... x)

Smaller repositories seem to work though. I just get a few warnings, including a wine message, not sure why. But I'll get a video and images.

Edit: I'm using Arch linux with Python 3.10.9

@initialcommit-io
Copy link
Contributor

@jwsloan @pindab0ter @fbrinker I just pushed a fix to these issues in git-sim version 0.1.5.

Please upgrade using pip install git-sim --upgrade and let me know if any issues after you retest.

Please note that for now, some merge commits involved in rebase operations may only show one of the child paths. I'm working on addressing that going forward.

@pindab0ter
Copy link

I did that, and I'm not getting the issue any more, thanks!

@fbrinker
Copy link

Same for me with merge and rebase, thanks :)

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

4 participants