KeyError in blame_hunk
- Dominant language
- Python
- Stars
- 319
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
I ran into some bug (on openSUSE-13.2 and Factory) using:
``` bash
git clone git://github.com/openstack/python-keystoneclient.git
cd python-keystoneclient/
git-deps 3d6d749e6f0fef682a88758e1a2f6c9e8e7bd23c
```
this produced
```
7920899af119d1697c333d202ca3272f167c19b0
[...some more hashes...]
Traceback (most recent call last):
File "/home/bernhard/bin/git-deps", line 790, in
main()
File "/home/bernhard/bin/git-deps", line 784, in main
cli(options, args)
File "/home/bernhard/bin/git-deps", line 671, in cli
detector.find_dependencies(dependent_rev)
File "/home/bernhard/bin/git-deps", line 402, in find_dependencies
self.find_dependencies_with_parent(dependent, parent)
File "/home/bernhard/bin/git-deps", line 426, in find_dependencies_with_parent
self.blame_hunk(dependent, parent, path, hunk)
File "/home/bernhard/bin/git-deps", line 529, in blame_hunk
rev = line_to_culprit[line_num]
KeyError: 2
```
Contributor guide
Research direction
Reproduce the failure with the git-deps command against commit 3d6d749e6f0fef682a88758e1a2f6c9e8e7bd23c, then inspect blame_hunk at line 529 and the caller find_dependencies_with_parent. Trace why line_to_culprit lacks line 2 and confirm that the command completes without the reported KeyError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- cli, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100