common: parser error fix resulting in deadlock #103

Open
adamm wants to merge 1 commits from git-deadlock-fix into main
Owner
No description provided.
adamm added 1 commit 2026-01-04 15:39:20 +01:00
adamm requested review from jzerebecki 2026-01-04 15:39:20 +01:00
adamm force-pushed git-deadlock-fix from a5627080b8 to 35558ef272 2026-01-04 15:55:25 +01:00 Compare
Owner

As 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.

As 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.
This pull request has changes conflicting with the target branch.
  • common/git_utils_test.go
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin git-deadlock-fix:git-deadlock-fix
git checkout git-deadlock-fix
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: git-workflow/autogits#103