Bug 236812 - [git-webkit] 'IndexError: list index out of range '
Summary: [git-webkit] 'IndexError: list index out of range '
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-17 16:52 PST by Ryan Haddad
Modified: 2022-12-07 12:55 PST (History)
3 users (show)

See Also:


Attachments
identifiers.json file from my machine (17.87 MB, text/plain)
2022-02-17 16:53 PST, Ryan Haddad
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Haddad 2022-02-17 16:52:09 PST
➜  monarch [~/sources/OpenSource] git-webkit pr
Branch 'main' set up to track remote branch 'main' from 'origin'.
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
From github.com:WebKit/WebKit
 * branch                      main       -> FETCH_HEAD
Current branch eng/236809-dashboard-cleanup is up to date.
Traceback (most recent call last):
  File "/Users/ryan/sources/Internal/Tools/Scripts/git-webkit", line 76, in <module>
    sys.exit(program.main(
  File "/Users/ryan/sources/OpenSource/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/__init__.py", line 134, in main
    return parsed.main(
  File "/Users/ryan/sources/OpenSource/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py", line 163, in main
    if repository.pull(rebase=True, branch=branch_point.branch):
  File "/Users/ryan/sources/OpenSource/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py", line 938, in pull
    self.cache.clear(self.branch)
  File "/Users/ryan/sources/OpenSource/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py", line 214, in clear
    self._fill(branch)
  File "/Users/ryan/sources/OpenSource/Tools/Scripts/libraries/webkitscmpy/webkitscmpy/local/git.py", line 81, in _fill
    branch_point = int(self._hash_to_identifiers[self._ordered_commits[branch][0]].split('@')[0])
IndexError: list index out of range
Comment 1 Ryan Haddad 2022-02-17 16:53:58 PST
Created attachment 452445 [details]
identifiers.json file from my machine
Comment 2 Ryan Haddad 2022-02-17 16:54:32 PST
Moving .git/identifiers.json aside fixed this for me.

I think I cancelled a git operation earlier, so maybe that put it in a bad state.
Comment 3 Radar WebKit Bug Importer 2022-04-05 11:59:47 PDT
<rdar://problem/91307826>
Comment 4 Jonathan Bedard 2022-12-06 07:45:34 PST
Pull request: https://github.com/WebKit/WebKit/pull/7200
Comment 5 Jonathan Bedard 2022-12-06 08:02:34 PST
I was finally able to reproduce this issue locally, it's caused by empty branch references being saved (which Ryan's uploaded identifiers.json corroborates). We don't have to throw out the entire cache, we just need to refuse to load empty branch references.
Comment 6 EWS 2022-12-07 12:54:56 PST
Committed 257505@main (9f6b01dab869): <https://commits.webkit.org/257505@main>

Reviewed commits have been landed. Closing PR #7200 and removing active labels.