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

"IndexError: list index out of range" crash in case of big merge commits are in the git tree #71

Open
aivus opened this issue Oct 22, 2019 · 0 comments · May be fixed by #72
Open

"IndexError: list index out of range" crash in case of big merge commits are in the git tree #71

aivus opened this issue Oct 22, 2019 · 0 comments · May be fixed by #72

Comments

@aivus
Copy link

aivus commented Oct 22, 2019

Sometimes I'm getting errors like this:

Traceback (most recent call last):
  File "/Users/aivus/envs/oro-doc-version/bin/sphinx-versioning", line 11, in <module>
    load_entry_point('sphinxcontrib-versioning', 'console_scripts', 'sphinx-versioning')()
  File "/Users/aivus/envs/oro-doc-version/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/aivus/projects/sphinxcontrib-versioning2/sphinxcontrib/versioning/__main__.py", line 78, in main
    return super(ClickGroup, self).main(args=argv, *args, **kwargs)
  File "/Users/aivus/envs/oro-doc-version/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/aivus/projects/sphinxcontrib-versioning2/sphinxcontrib/versioning/__main__.py", line 89, in invoke
    return super(ClickGroup, self).invoke(ctx)
  File "/Users/aivus/envs/oro-doc-version/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/aivus/envs/oro-doc-version/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/aivus/envs/oro-doc-version/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/aivus/envs/oro-doc-version/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/aivus/envs/oro-doc-version/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/aivus/projects/sphinxcontrib-versioning2/sphinxcontrib/versioning/__main__.py", line 276, in build
    remotes = gather_git_info(config.git_root, conf_rel_paths, config.whitelist_branches, config.whitelist_tags)
  File "/Users/aivus/projects/sphinxcontrib-versioning2/sphinxcontrib/versioning/routines.py", line 66, in gather_git_info
    dates_paths = filter_and_date(root, conf_rel_paths, (i[0] for i in remotes))
  File "/Users/aivus/projects/sphinxcontrib-versioning2/sphinxcontrib/versioning/git.py", line 246, in filter_and_date
    dates_paths[commit][0] = timestamps[i]
IndexError: list index out of range

It's caused by the output of the git command

command_prefix = ['git', 'show', '--no-patch', '--pretty=format:%ct']

and this command returns:

1469536315
1562067662
1564053167
1565885343warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 2904 and retry the command.

1534772109warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 2904 and retry the command.

1471512478warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 2904 and retry the command.

1512992270warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 2904 and retry the command.

1564866513warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 2904 and retry the command.

1558289348warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 2904 and retry the command.

1475080037
1458561908
1549283009
1471256827
1565886066
1466433308
1536179026
1472121849
1562321286
1565824289
1558624388
1562067501
1468573872
1563360646
1470395248
1539976798
1505294206
1565009621
1564058239
1565594111
1565888192
1565888350
1565888224
1564761073
1559229466

It can be fixed by removing $ from this regexp:

RE_UNIX_TIME = re.compile(r'^\d{10}$', re.MULTILINE)

Regexp verification:
https://regex101.com/r/Lz0Y8I/1

@aivus aivus linked a pull request Oct 22, 2019 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant