Skip to content

refactor: unify verbosity levels and remove quiet flag (#030)#30

Merged
laggu merged 2 commits intodevelopfrom
gv-030
Feb 27, 2026
Merged

refactor: unify verbosity levels and remove quiet flag (#030)#30
laggu merged 2 commits intodevelopfrom
gv-030

Conversation

@laggu
Copy link
Owner

@laggu laggu commented Feb 26, 2026

Summary

  • Replace boolean --verbose/--quiet with a level-based verbosity model (--verbose 0/1/2) and remove --quiet.
  • Normalize output behavior across commands (errors/warnings to stderr, summary/detail gated by verbosity level) and update related tests.
  • Update docs/translations and integration shell tests to use the new verbosity interface (--verbose 0) and support shorthand -v as detailed mode.

Verification

  • go test ./...
  • go build -v ./...
  • bash test/integration.sh

@gemini-code-assist
Copy link

Summary of Changes

Hello @laggu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the command-line interface's output control by consolidating separate verbose and quiet flags into a unified, numerical verbosity level. This change streamlines how users manage output detail, ensuring consistent behavior across all commands and improving the overall user experience by providing more granular control over logging without redundant flags.

Highlights

  • Unified Verbosity Levels: Replaced the boolean --verbose and --quiet flags with a single, level-based --verbose flag, allowing for 0 (errors only), 1 (normal, default), and 2 (detailed) output.
  • Standardized Output Behavior: Normalized output across commands, directing errors and warnings to stderr and gating summary and detailed output based on the new verbosity levels.
  • Documentation and Test Updates: Updated all relevant documentation (READMEs, specs) and integration tests to reflect the new verbosity interface and the removal of the --quiet flag.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • CLAUDE.md
    • Updated CLI structure documentation to remove the --quiet flag.
  • README.md
    • Updated documentation for the --verbose flag to describe its new level-based behavior and removed the --quiet flag entry.
  • cmd/global.go
    • Updated gitvolume.New call to use the new commandOptions helper.
  • cmd/global_add.go
    • Updated gitvolume.New call to use the new commandOptions helper.
  • cmd/global_edit.go
    • Updated gitvolume.New call to use the new commandOptions helper.
  • cmd/global_remove.go
    • Updated gitvolume.New call to use the new commandOptions helper.
  • cmd/init.go
    • Updated gitvolume.New call to use the new commandOptions helper.
  • cmd/root.go
    • Refactored global flags from boolean verbose and quiet to an integer verbosity level.
    • Added validation for the verbosity level in PersistentPreRunE.
    • Introduced a commandOptions helper function to construct gitvolume.Options.
    • Set NoOptDefVal for the --verbose flag to '2' to enable shorthand -v for detailed mode.
  • cmd/status.go
    • Updated gitvolume.New call to use the new commandOptions helper.
  • cmd/sync.go
    • Updated gitvolume.New call to use the new commandOptions helper.
  • cmd/unsync.go
    • Updated gitvolume.New call to use the new commandOptions helper.
  • docs/specs/spec.md
    • Updated specification documentation to reflect the new --verbose flag with integer levels and removed --quiet.
  • docs/translations/README_de.md
    • Updated German README to reflect the new --verbose flag with integer levels and removed --quiet.
  • docs/translations/README_es.md
    • Updated Spanish README to reflect the new --verbose flag with integer levels and removed --quiet.
  • docs/translations/README_fr.md
    • Updated French README to reflect the new --verbose flag with integer levels and removed --quiet.
  • docs/translations/README_it.md
    • Updated Italian README to reflect the new --verbose flag with integer levels and removed --quiet.
  • docs/translations/README_ja.md
    • Updated Japanese README to reflect the new --verbose flag with integer levels and removed --quiet.
  • docs/translations/README_ko.md
    • Updated Korean README to reflect the new --verbose flag with integer levels and removed --quiet.
  • docs/translations/README_pt.md
    • Updated Portuguese README to reflect the new --verbose flag with integer levels and removed --quiet.
  • docs/translations/README_zh.md
    • Updated Chinese README to reflect the new --verbose flag with integer levels and removed --quiet.
  • internal/gitvolume/add.go
    • Modified output logic to use verbosity levels and direct error messages to os.Stderr.
  • internal/gitvolume/add_test.go
    • Updated test cases to use VerbosityQuiet constant.
  • internal/gitvolume/context.go
    • Modified Load and loadConfig functions to accept an integer verbosity level instead of a boolean quiet flag.
    • Updated warning output logic to respect the new verbosity levels.
  • internal/gitvolume/context_test.go
    • Updated test cases to use VerbosityQuiet constant.
  • internal/gitvolume/edit.go
    • Modified output logic to use verbosity levels and direct error messages to os.Stderr.
  • internal/gitvolume/edit_test.go
    • Updated test cases to use VerbosityQuiet constant.
  • internal/gitvolume/gitvolume.go
    • Refactored GitVolume struct to use an integer verbosity field instead of separate verbose and quiet booleans.
    • Defined VerbosityQuiet, VerbosityNormal, and VerbosityDetailed constants.
    • Added normalizeVerbosity function to ensure verbosity levels are within bounds.
    • Added helper methods (isErrorsOnly, isNormalOrHigher, isDetailed) for checking verbosity levels.
  • internal/gitvolume/gitvolume_test.go
    • Updated test cases to use VerbosityQuiet constant.
  • internal/gitvolume/init.go
    • Modified output logic to use verbosity levels and direct error messages to os.Stderr.
  • internal/gitvolume/init_test.go
    • Updated test cases to use VerbosityQuiet and VerbosityNormal constants.
  • internal/gitvolume/list.go
    • Modified output logic to use verbosity levels.
  • internal/gitvolume/list_test.go
    • Updated test cases to use VerbosityQuiet constant.
  • internal/gitvolume/remove.go
    • Modified output logic to use verbosity levels and direct error messages to os.Stderr.
  • internal/gitvolume/status.go
    • Modified output logic to use verbosity levels.
  • internal/gitvolume/sync.go
    • Modified output logic to use verbosity levels and direct error messages to os.Stderr.
  • internal/gitvolume/sync_test.go
    • Updated test cases to use VerbosityDetailed and VerbosityNormal constants.
  • internal/gitvolume/unsync.go
    • Modified output logic to use verbosity levels and direct warning/error messages to os.Stderr.
  • test/integration.sh
    • Updated integration tests to use --verbose 0 instead of -q for quiet operations.
Activity
  • The pull request was created by laggu.
  • This pull request introduces a significant refactoring of the verbosity system, replacing boolean flags with a more flexible level-based approach.
  • No specific reviewer comments or approvals are available in the provided context, indicating this is likely an initial submission or early stage of review.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a great refactoring that unifies the output verbosity control. Replacing the separate --verbose and --quiet flags with a single, level-based --verbose flag is a significant improvement for the CLI's user experience and internal consistency. The changes are implemented cleanly across all commands, tests, and documentation. The use of helper functions for verbosity checks and directing error/warning output to stderr are excellent practices. I found one minor issue regarding an unused helper function, which I've commented on.

@laggu laggu merged commit a64cd68 into develop Feb 27, 2026
6 checks passed
@laggu laggu deleted the gv-030 branch February 27, 2026 14:57
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

Successfully merging this pull request may close these issues.

1 participant