jbrukh / ggit

ggit
17 stars 2 forks source link

ggit-ls-objects returns a nil for some object. #35

Closed jbrukh closed 12 years ago

jbrukh commented 12 years ago

... 97d347b8147942fe5308377c90ed8559c3bc8300 7b558772c73eea215ed956dda25783fc73fcbf6f 9a3b5b83fc3daafc1b7a2b42b0dd28d4e4d0abdf 05e413b4e5fa4871c47600f68663ec025188900c 2fd999973d9195a285de71f8e9e3c48d160c8aa2 543b9bebdc6bd5c4b22136034a95dd097a57d3dd panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x18 pc=0x32206]

goroutine 1 [running]: github.com/jbrukh/ggit/api.(_ObjectId).String(0x0, 0x422c8008, 0x44229ed88, 0x100000001) /Users/jbrukh/gocode/src/github.com/jbrukh/ggit/api/object_id.go:88 +0x23 github.com/jbrukh/ggit/builtin.(_LsObjectsBuiltin).Execute(0x23daa0, 0x422b07e0, 0x422ae080, 0x0) /Users/jbrukh/gocode/src/github.com/jbrukh/ggit/builtin/ls_objects.go:40 +0x1ac main.main() /Users/jbrukh/gocode/src/github.com/jbrukh/ggit/cmd/ggit/ggit.go:80 +0x65a

goroutine 2 [syscall]: created by runtime.main /private/tmp/bindist157186712/go/src/pkg/runtime/proc.c:221

goroutine 3 [finalizer wait]: created by runtime.gc /private/tmp/bindist157186712/go/src/pkg/runtime/mgc0.c:882

MikeBosw commented 12 years ago

since e5c0153

nil DiskRepository

MikeBosw commented 12 years ago

try

git checkout -B foo e5c0153 && gg ls-objects

vs

git checkout -B foo e5c0153^ && gg ls-objects

MikeBosw commented 12 years ago

resolved

jbrukh commented 12 years ago

Hey, sorry, I might be missing something. You definitely fixed a bug that I introduced, thanks. However, for the ggit version on branch "fd694f04f788b77cdf62aac1acf2fc030746c8b3", when I run:

ggit ls-objects --packed

I get

panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x18 pc=0x323e9]

goroutine 1 [running]: github.com/jbrukh/ggit/api.(_ObjectId).String(0x0, 0x422d5008, 0x4422a8d30, 0x100000001) /Users/jbrukh/gocode/src/github.com/jbrukh/ggit/api/object_id.go:88 +0x23 github.com/jbrukh/ggit/builtin.printAll(0x422bd810, 0x42744000, 0x28700000287, 0x0) /Users/jbrukh/gocode/src/github.com/jbrukh/ggit/builtin/ls_objects.go:80 +0x74 github.com/jbrukh/ggit/builtin.(_LsObjectsBuiltin).Execute(0x248010, 0x422bd810, 0x422bd3e0, 0x100000001, 0x422d5010, ...) /Users/jbrukh/gocode/src/github.com/jbrukh/ggit/builtin/ls_objects.go:75 +0x25f main.main() /Users/jbrukh/gocode/src/github.com/jbrukh/ggit/cmd/ggit/ggit.go:80 +0x65a

goroutine 2 [syscall]: created by runtime.main /private/tmp/bindist157186712/go/src/pkg/runtime/proc.c:221

goroutine 3 [finalizer wait]: created by runtime.gc /private/tmp/bindist157186712/go/src/pkg/runtime/mgc0.c:882

after the printed commit "543b9bebdc6bd5c4b22136034a95dd097a57d3dd".

MikeBosw commented 12 years ago

tried it, but no luck. so it has something to do with the difference between our .git folders... whatever that may be.

if you run git gc (might want to back up your .git folder first, to preserve the error condition), and then run the same command, do you still see that error? at some point i did a git gc for pack testing.

jbrukh commented 12 years ago

Fixed.

Now "ggcompare ." passes!