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.11k stars 102 forks source link

shell completion command failed when cwd is local git repo #789

Closed georgexsh closed 2 years ago

georgexsh commented 2 years ago

I am using lab version 0.23.0, bash 5.1, steps to reproduce this issue:

lab completion outputs a line of log to stdout like 2022/02/10 13:07:32 root.go:205: No default remote found, which bash's source doesn't understand. I guess a possible solution is always output log to stderr rather than stdout, or bypass local git remote checking when the command is lab completion.

bmeneg commented 2 years ago

@georgexsh thanks for the report! And your suggestions are indeed correct. I'll check what fits better and prepare the PR.

bmeneg commented 2 years ago

@georgexsh #792 should solve the issue with lab completion.

bmeneg commented 2 years ago

I'm going to close this issue. But in case you see any other problems, please feel free to reopen it or open a new issue!

Many thanks for the report @georgexsh

georgexsh commented 2 years ago

@bmeneg the fix works, thanks! but I still wonder why the logs would be writing to stdout.

bmeneg commented 2 years ago

@georgexsh That's a valid point: not sure why, but when I wrote the logs I let only the "error" level to be written to stderr, while others "info, warn and debug" would go stdout.

But yes, anything that isn't part of the program's standard output, shouldn't go to stdout. I'm going to prepare another PR suggesting this change.