git-sim icon indicating copy to clipboard operation
git-sim copied to clipboard

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

Open jwsloan opened this issue 2 years ago • 10 comments

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

jwsloan avatar Jan 23 '23 14:01 jwsloan

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.

pindab0ter avatar Jan 23 '23 17:01 pindab0ter

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?

initialcommit-io avatar Jan 23 '23 22:01 initialcommit-io

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.

pindab0ter avatar Jan 24 '23 16:01 pindab0ter

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?

jwsloan avatar Jan 24 '23 17:01 jwsloan

I just need a basic understanding of the structure of the 2 branches involved in the rebase. On Jan 24, 2023, at 9:04 AM, John Sloan @.***> wrote: 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?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

initialcommit-io avatar Jan 24 '23 17:01 initialcommit-io

@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.

initialcommit-io avatar Jan 25 '23 09:01 initialcommit-io

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

fbrinker avatar Jan 25 '23 12:01 fbrinker

@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.

initialcommit-io avatar Jan 26 '23 05:01 initialcommit-io

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

pindab0ter avatar Jan 26 '23 09:01 pindab0ter

Same for me with merge and rebase, thanks :)

fbrinker avatar Jan 26 '23 09:01 fbrinker