Bug 236812

Summary: [git-webkit] 'IndexError: list index out of range '
Product: WebKit Reporter: Ryan Haddad <ryanhaddad>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: jbedard, mcatanzaro, webkit-bug-importer, yurys
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
identifiers.json file from my machine none

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.
Comment 7 EWS 2022-12-13 16:43:24 PST
Committed 252432.936@safari-7614-branch (b9812d25922f): <https://commits.webkit.org/252432.936@safari-7614-branch>

Reviewed commits have been landed. Closing PR #244 and removing active labels.
Comment 8 Jonathan Bedard 2023-01-05 16:05:03 PST
*** Bug 240533 has been marked as a duplicate of this bug. ***