zaquestion / lab

Lab wraps Git or Hub, making it simple to clone, fork, and interact with repositories on GitLab
https://zaquestion.github.io/lab
Creative Commons Zero v1.0 Universal
1.1k stars 103 forks source link

Multiple commands produce an empty output #891

Closed gobenji closed 3 months ago

gobenji commented 3 months ago

I'm trying to use lab but many/most commands produce an empty output, for example:

ben@f4:~$ lab project list
ben@f4:~$ echo $?
0
ben@f4:~$ cd /tmp/centos-stream-9/
ben@f4:/tmp/centos-stream-9$ lab mr list
ben@f4:/tmp/centos-stream-9$ echo $?
0
ben@f4:/tmp/centos-stream-9$ lab --debug mr list
2024/03/06 17:44:01 DEBUG: client.go:612: performing request
2024/03/06 17:44:01 DEBUG:      method = GET
ben@f4:/tmp/centos-stream-9$

I ran these commands within a fresh clone of the redhat/centos-stream/src/kernel/centos-stream-9 repository.

Some commands work, for example the lab token list command produces sensible output, lab mr browse <id> opens a browser on the expected page.

I built lab from git:

$ lab --version
lab version v0.25.1-49-g29804ac

I'm running on Debian Sid.

In an attempt to narrow down the issue, I spawned a docker container for the "fedora" image and installed lab from https://copr.fedorainfracloud.org/coprs/bmeneguele/rhkernel-devtools/. I created a docker volume to expose the above centos-stream-9 clone in the container. Things work as expected there. I copied the lab config file from the container and the lab binary to my host. Same problems as above - commands have empty outputs. I did a similar experiment with the debian:unstable container where I built lab and it worked in the container.

I guess the issue is related to my environment but I don't know what part. I tried to unset all environment variables but it did not help:

ben@f4:/tmp/centos-stream-9$ HOME=/home/ben PATH=/usr/bin ~/local/bin/lab mr list
ben@f4:/tmp/centos-stream-9$

Please let me know if you have some suggestions to narrow things down.

gobenji commented 3 months ago

I have narrowed down the issue to the fact that I have core.pager set to the empty string in my .gitconfig, ie.

git config --global --replace-all core.pager ""

git-config(1) says:

To disable pagination for all commands, set core.pager or GIT_PAGER to cat.

I have done that and it avoids the problems with lab that I reported in this ticket.