common: parser error fix resulting in deadlock #103
Reference in New Issue
Block a user
Delete Branch "git-deadlock-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
a5627080b8to35558ef272As I'll switch to reviewing another more important PR before this is finished I'll add some general comments I had.
This seems like it implements generic git functionality, so why not use one of the existing libraries? E.g. https://github.com/libgit2/git2go or https://github.com/go-git/go-git . Both solve these problems already.
This is using cmd.Run() which is designed to both Start and block for the cmd to finish instead of cmd.Start() which allows you to control when to block/wait, with the later you would not need a goroutine.
This is reading byte wise. I wonder if that is very inefficient with a syscall per byte, or if go magically batches big reads. Also this is using a channel, which feels cumbersome, instead of the filedesciptor directly. The appropriator functions would be: https://pkg.go.dev/io#WriteString , https://pkg.go.dev/io#PipeReader.Read , https://pkg.go.dev/syscall#Select .
Not sure if the last two make this more difficult to read than necessary.
But I will continue reviewing this later.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.