sourcegraph / srclib

srclib is a polyglot code analysis library, built for hackability. It consists of language analysis toolchains (currently for Go and Java, with Python, JavaScript, and Ruby in beta) with a common output format, and a CLI tool for running the analysis.
https://srclib.org
Other
942 stars 62 forks source link

interactive branch panics on "src repo" #128

Closed sqs closed 9 years ago

sqs commented 9 years ago

Repro:

  1. Check out a GitHub repo
  2. In the repo dir, run src repo

The error is:

~/src/github.com/linkedin/rest.li $ src repo
# Local repository:
Root directory: /home/sqs/src/github.com/linkedin/rest.li
VCS type:   git
Commit ID:  db9b5d13d1d345fa27cf41b41938f0d003e054f2
Clone URL:  https://github.com/linkedin/rest.li.git

panic: empty RepoSpec

goroutine 1 [running]:
sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph.RepoSpec.PathComponent(0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sqs/src/sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph/repositories.go:162 +0x1d8
sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph.RepoSpec.RouteVars(0x0, 0x0, 0x0, 0x5408e4)
    /home/sqs/src/sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph/repositories.go:168 +0x34
sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph.(*repositoriesService).Get(0xc20828ce20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sqs/src/sourcegraph.com/sourcegraph/go-sourcegraph/sourcegraph/repositories.go:295 +0x6f
sourcegraph.com/sourcegraph/srclib/src.getRemoteRepo(0xc208276300, 0x0, 0x0, 0x0)
    /home/sqs/src/sourcegraph.com/sourcegraph/srclib/src/remote_helpers.go:26 +0x160
sourcegraph.com/sourcegraph/srclib/src.(*RepoCmd).Execute(0xe16a40, 0xc2082cf280, 0x0, 0x1, 0x0, 0x0)
    /home/sqs/src/sourcegraph.com/sourcegraph/srclib/src/repo_cmds.go:43 +0x6cf
sourcegraph.com/sourcegraph/go-flags.(*Parser).ParseArgs(0xc20821d6e0, 0xc20800a010, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sqs/src/sourcegraph.com/sourcegraph/go-flags/parser.go:242 +0x7bd
sourcegraph.com/sourcegraph/go-flags.(*Parser).Parse(0xc20821d6e0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/sqs/src/sourcegraph.com/sourcegraph/go-flags/parser.go:137 +0xb1
sourcegraph.com/sourcegraph/srclib/src.Main(0x0, 0x0)
    /home/sqs/src/sourcegraph.com/sourcegraph/srclib/src/cli.go:123 +0x61
main.main()
    /home/sqs/src/sourcegraph.com/sourcegraph/srclib/cmd/src/src.go:28 +0x3ae

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1

goroutine 5 [syscall]:
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
    /usr/local/go/src/os/signal/signal_unix.go:27 +0x35

With srclib master:

~/src/github.com/linkedin/rest.li $ src repo
# Local repository:
Root directory: /home/sqs/src/github.com/linkedin/rest.li
VCS type:   git
Commit ID:  db9b5d13d1d345fa27cf41b41938f0d003e054f2
Clone URL:  https://github.com/linkedin/rest.li.git

# Remote repository:
URI:        github.com/linkedin/rest.li
Homepage:   rest.li
Clone (HTTP):   https://github.com/linkedin/rest.li.git (git)
Clone (SSH):    ssh://git@github.com/linkedin/rest.li.git (git)
Default branch: master
Language:   Java
Created at: 2012-11-30 19:37:51 +0000 UTC
Updated at: 2015-03-22 00:49:02 +0000 UTC
Pushed at:  2015-03-19 20:47:02 +0000 UTC