Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] fatal: expected flush after ref listing #15

Open
adlternative opened this issue Nov 26, 2022 · 4 comments
Open

[BUG] fatal: expected flush after ref listing #15

adlternative opened this issue Nov 26, 2022 · 4 comments

Comments

@adlternative
Copy link

I use this tool for git clone, which met a bug:

$ git-http-backend --project_root=. --git_bin_path=/home/adl/git/bin-wrappers/git
$ git clone http://localhost:8080/mono-repo.git 
Cloning into 'mono-repo'...
fatal: expected flush after ref listing

system: Linux adl 6.0.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 10 Nov 2022 21:14:24 +0000 x86_64 GNU/Linux
git version: 2.38.1

@adlternative
Copy link
Author

Ah, I probably know why.
My local GIT_PROTOCOL=version=2

This means that git upload-pack --stateless-rpc --advertise-refs . v2 action is diff from v0/v1!

$ GIT_PROTOCOL=version=1 git upload-pack --stateless-rpc --advertise-refs .
000eversion 1
0124a0789512c5a4ae7da935cd2e419f253cb3cb4ce7 HEADmulti_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed no-done symref=HEAD:refs/heads/master filter object-format=sha1 agent=git/2.38.1.280.g63bba4fdd8
003fa0789512c5a4ae7da935cd2e419f253cb3cb4ce7 refs/heads/master
0045d5aef6e4d58cfe1549adef5b436f3ace984e8c86 refs/tags/gitgui-0.10.0
00483d654be48f65545c4d3e35f5d3bbed5489820930 refs/tags/gitgui-0.10.0^{}
....

GIT_PROTOCOL=version=0 git upload-pack --stateless-rpc --advertise-refs . | head
0124a0789512c5a4ae7da935cd2e419f253cb3cb4ce7 HEADmulti_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed no-done symref=HEAD:refs/heads/master filter object-format=sha1 agent=git/2.38.1.280.g63bba4fdd8
003fa0789512c5a4ae7da935cd2e419f253cb3cb4ce7 refs/heads/master
0045d5aef6e4d58cfe1549adef5b436f3ace984e8c86 refs/tags/gitgui-0.10.0
00483d654be48f65545c4d3e35f5d3bbed5489820930 refs/tags/gitgui-0.10.0^{}

$ GIT_PROTOCOL=version=2 git upload-pack --stateless-rpc --advertise-refs . | head
000eversion 2
0025agent=git/2.38.1.280.g63bba4fdd8
0013ls-refs=unborn
0027fetch=shallow wait-for-done filter
0012server-option
0017object-format=sha1
0010object-info
0000%                               

So I can presume that you haven't handled this behavior of V2 correctly.

@Th1nkMore
Copy link
Contributor

Th1nkMore commented Nov 26, 2022

Ah, I probably know why. My local GIT_PROTOCOL=version=2

This means that git upload-pack --stateless-rpc --advertise-refs . v2 action is diff from v0/v1!

$ GIT_PROTOCOL=version=1 git upload-pack --stateless-rpc --advertise-refs .
000eversion 1
0124a0789512c5a4ae7da935cd2e419f253cb3cb4ce7 HEADmulti_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed no-done symref=HEAD:refs/heads/master filter object-format=sha1 agent=git/2.38.1.280.g63bba4fdd8
003fa0789512c5a4ae7da935cd2e419f253cb3cb4ce7 refs/heads/master
0045d5aef6e4d58cfe1549adef5b436f3ace984e8c86 refs/tags/gitgui-0.10.0
00483d654be48f65545c4d3e35f5d3bbed5489820930 refs/tags/gitgui-0.10.0^{}
....

GIT_PROTOCOL=version=0 git upload-pack --stateless-rpc --advertise-refs . | head
0124a0789512c5a4ae7da935cd2e419f253cb3cb4ce7 HEADmulti_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed no-done symref=HEAD:refs/heads/master filter object-format=sha1 agent=git/2.38.1.280.g63bba4fdd8
003fa0789512c5a4ae7da935cd2e419f253cb3cb4ce7 refs/heads/master
0045d5aef6e4d58cfe1549adef5b436f3ace984e8c86 refs/tags/gitgui-0.10.0
00483d654be48f65545c4d3e35f5d3bbed5489820930 refs/tags/gitgui-0.10.0^{}

$ GIT_PROTOCOL=version=2 git upload-pack --stateless-rpc --advertise-refs . | head
000eversion 2
0025agent=git/2.38.1.280.g63bba4fdd8
0013ls-refs=unborn
0027fetch=shallow wait-for-done filter
0012server-option
0017object-format=sha1
0010object-info
0000%                               

So I can presume that you haven't handled this behavior of V2 correctly.

Oh, it's a small bug in fact and I just fixed it, you can check the latest commit : )

@adlternative
Copy link
Author

Ah, I probably know why. My local GIT_PROTOCOL=version=2
This means that git upload-pack --stateless-rpc --advertise-refs . v2 action is diff from v0/v1!

$ GIT_PROTOCOL=version=1 git upload-pack --stateless-rpc --advertise-refs .
000eversion 1
0124a0789512c5a4ae7da935cd2e419f253cb3cb4ce7 HEADmulti_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed no-done symref=HEAD:refs/heads/master filter object-format=sha1 agent=git/2.38.1.280.g63bba4fdd8
003fa0789512c5a4ae7da935cd2e419f253cb3cb4ce7 refs/heads/master
0045d5aef6e4d58cfe1549adef5b436f3ace984e8c86 refs/tags/gitgui-0.10.0
00483d654be48f65545c4d3e35f5d3bbed5489820930 refs/tags/gitgui-0.10.0^{}
....

GIT_PROTOCOL=version=0 git upload-pack --stateless-rpc --advertise-refs . | head
0124a0789512c5a4ae7da935cd2e419f253cb3cb4ce7 HEADmulti_ack thin-pack side-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed no-done symref=HEAD:refs/heads/master filter object-format=sha1 agent=git/2.38.1.280.g63bba4fdd8
003fa0789512c5a4ae7da935cd2e419f253cb3cb4ce7 refs/heads/master
0045d5aef6e4d58cfe1549adef5b436f3ace984e8c86 refs/tags/gitgui-0.10.0
00483d654be48f65545c4d3e35f5d3bbed5489820930 refs/tags/gitgui-0.10.0^{}

$ GIT_PROTOCOL=version=2 git upload-pack --stateless-rpc --advertise-refs . | head
000eversion 2
0025agent=git/2.38.1.280.g63bba4fdd8
0013ls-refs=unborn
0027fetch=shallow wait-for-done filter
0012server-option
0017object-format=sha1
0010object-info
0000%                               

So I can presume that you haven't handled this behavior of V2 correctly.

Oh, it's a small bug in fact and I just fixed it, you can check the latest commit : )

Cool, you did fix it, good job!

@danacr
Copy link

danacr commented Sep 6, 2023

This is awesome! Can @Th1nkMore trigger a new release so we don't have to get the master branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants