-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
--quiet
is not usable as a global option with gitea web
#22361
Labels
Comments
silverwind
pushed a commit
that referenced
this issue
Jun 28, 2023
More fix for #24981 * #24981 Close #22361 * #22361 There were many patches for Gitea's sub-commands to satisfy the facts: * Some sub-commands shouldn't output any log, otherwise the git protocol would be broken * Sometimes the users want to see "verbose" or "quiet" outputs That's a longstanding problem, and very fragile. This PR is only a quick patch for the problem. In the future, the sub-command system should be refactored to a clear solution. ---- Other changes: * Use `ReplaceAllWriters` to replace `RemoveAllWriters().AddWriters(writer)`, then it's an atomic operation. * Remove unnecessary `syncLevelInternal` calls, because `AddWriters/addWritersInternal` already calls it. Co-authored-by: Giteabot <teabot@gitea.io>
wxiaoguang
added a commit
to wxiaoguang/gitea
that referenced
this issue
Jun 28, 2023
More fix for go-gitea#24981 * go-gitea#24981 Close go-gitea#22361 * go-gitea#22361 There were many patches for Gitea's sub-commands to satisfy the facts: * Some sub-commands shouldn't output any log, otherwise the git protocol would be broken * Sometimes the users want to see "verbose" or "quiet" outputs That's a longstanding problem, and very fragile. This PR is only a quick patch for the problem. In the future, the sub-command system should be refactored to a clear solution. ---- Other changes: * Use `ReplaceAllWriters` to replace `RemoveAllWriters().AddWriters(writer)`, then it's an atomic operation. * Remove unnecessary `syncLevelInternal` calls, because `AddWriters/addWritersInternal` already calls it. Co-authored-by: Giteabot <teabot@gitea.io>
lunny
pushed a commit
that referenced
this issue
Jun 28, 2023
Backport #25537 More fix for #24981 * #24981 Close #22361, #25552 * #22361 * #25552 There were many patches for Gitea's sub-commands to satisfy the facts: * Some sub-commands shouldn't output any log, otherwise the git protocol would be broken * Sometimes the users want to see "verbose" or "quiet" outputs That's a longstanding problem, and very fragile. This PR is only a quick patch for the problem. In the future, the sub-command system should be refactored to a clear solution. ---- Other changes: * Use `ReplaceAllWriters` to replace `RemoveAllWriters().AddWriters(writer)`, then it's an atomic operation. * Remove unnecessary `syncLevelInternal` calls, because `AddWriters/addWritersInternal` already calls it.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
Per
gitea --help
, the correct order of arguments is as follows:and the global options list includes
However, executing
gitea -q web
does not work (the initial logger level is stillInfo
rather thanFatal
) whilegitea web -q
does work.It seems
quiet
is actually defined as a subcommand-specific cli boolean flag inweb.go
for theweb
subcommand associated with therunWeb
action:gitea/cmd/web.go
Lines 51 to 53 in d42b52f
I'd file a PR but I'm not clear on the intended behavior. It seems that the concept of global options might be altogether incorrect here since the switch is defined for a specific command and in
runWeb
the context associated with that particular command is queried forquiet
, so it seems like you might prefer that the output/organization ofgitea --help
be patched rather than the actual querying behavior. I'm not sure if--quiet
was previously a global option and now it's a command-specific one or if it's really only meant when runninggitea -q
rather thangitea -q web
.Gitea Version
1.19.0+dev-43-g57df0f116
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
N/A
Operating System
FreeBSD
How are you running Gitea?
Self-hosted, from the command-line.
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: