guilhem / bump

CLI to bump version tag in a git repository following semver
Apache License 2.0
25 stars 3 forks source link

panic: runtime error: index out of range [0] with length 0 #17

Open halkeye opened 7 months ago

halkeye commented 7 months ago
$ bump minor --allow-dirty
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/guilhem/bump/pkg/semver.Latest({0x0, 0x0, 0x2?})
 /home/halkeye/go/pkg/mod/github.com/guilhem/bump@v0.2.1/pkg/semver/semver.go:60 +0x186
github.com/guilhem/bump/cmd.preRun(0xe47760, {0x9def6e?, 0x4?, 0x9def72?})
 /home/halkeye/go/pkg/mod/github.com/guilhem/bump@v0.2.1/cmd/root.go:116 +0x29d
github.com/spf13/cobra.(*Command).execute(0xe47760, {0xc000119a30, 0x1, 0x1})
 /home/halkeye/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:835 +0x5c3
github.com/spf13/cobra.(*Command).ExecuteC(0xe47c60)
 /home/halkeye/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x38d
github.com/spf13/cobra.(*Command).Execute(...)
 /home/halkeye/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
 /home/halkeye/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:895
github.com/guilhem/bump/cmd.Execute()
 /home/halkeye/go/pkg/mod/github.com/guilhem/bump@v0.2.1/cmd/root.go:63 +0x1f8
main.main()
 /home/halkeye/go/pkg/mod/github.com/guilhem/bump@v0.2.1/main.go:21 +0xf

I think its having trouble with grabbing tags?

$  bump minor --allow-dirty --latest-tag=false
Use the arrow keys to navigate: ↓ ↑ → ←
? Select Previous tag:

No results

Though there are tags

$  git tag
v0.1.0
v0.2.0
guilhem commented 7 months ago

@halkeye bump should not panic now, but I have to dig more why there is no tags listed by go-git

halkeye commented 6 months ago

Yea i'm not sure either, maybe annotated tags?

Either way, tried it again on a different project and its happy

\o/ thanks