aspiers / git-deps

git commit dependency analysis tool
GNU General Public License v2.0
298 stars 47 forks source link

Stack dump testing paramiko 2.2.3 against 56c96a65 #79

Open KeithMnemonic opened 5 years ago

KeithMnemonic commented 5 years ago

Running these commands

git clone https://github.com/paramiko/paramiko.git
cd paramiko
git checkout -b my2.2.3 2.2.3
git tag to-backport 56c96a65
git deps -r -e my2.2.3

I get

Fatal: -L invalid line number: 0
Traceback (most recent call last):
  File "/usr/bin/git-deps", line 10, in <module>
    sys.exit(run())
  File "/usr/lib/python3.6/site-packages/git_deps/cli.py", line 141, in run
    main(sys.argv[1:])
  File "/usr/lib/python3.6/site-packages/git_deps/cli.py", line 135, in main
    cli(options, args)
  File "/usr/lib/python3.6/site-packages/git_deps/cli.py", line 119, in cli
    detector.find_dependencies(rev)
  File "/usr/lib/python3.6/site-packages/git_deps/detector.py", line 122, in find_dependencies
    self.find_dependencies_with_parent(dependent, parent)
  File "/usr/lib/python3.6/site-packages/git_deps/detector.py", line 147, in find_dependencies_with_parent
    self.blame_hunk(dependent, parent, path, hunk)
  File "/usr/lib/python3.6/site-packages/git_deps/detector.py", line 172, in blame_hunk
    blame = subprocess.check_output(cmd, universal_newlines=True)
  File "/usr/lib64/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/lib64/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'blame', '--porcelain', '-L', '0,+0', '20b69e7735e8c7e8bf63ee4df2c6a6b34743e646', '--', 'tests/__init__.py']' returned non-zero exit status 128.
aspiers commented 5 years ago

Same error message as #41 but here it looks like you are simply missing the parameter saying what to analyze. Shouldn't you have instead run

git deps -r -e my2.2.3 to-backport

? Although even if so, git-deps should certainly do a better job of input validation instead of just crashing.