-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add config flag to toggle verbose Git repository output. #763
Conversation
If `true`: the default, no change. If `false`: Only show repositories that have been updated or have an error. Minor tweak to output (removed colon) so that copy and paste for 'cd' is nicer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
I wonder can we do this with logs? Then we can toggle them via log level, Topgrade already has a --verbose
option, IMHO, it would match this well
Easy enough! Just pushed a new commit. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #763 +/- ##
========================================
+ Coverage 5.02% 6.61% +1.59%
========================================
Files 37 37
Lines 12114 12180 +66
========================================
+ Hits 609 806 +197
+ Misses 11505 11374 -131 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, I consider this as a breaking change, could you please document it in BREAKINGCHANGES_dev.md, here is a guideline on how to add it: https://github.com/topgrade-rs/topgrade/blob/main/CONTRIBUTING.md#breaking-changes
src/steps/git.rs
Outdated
@@ -292,10 +292,12 @@ impl RepoStep { | |||
} | |||
|
|||
/// Try to pull a repo. | |||
async fn pull_repo<P: AsRef<Path>>(&self, ctx: &ExecutionContext<'_>, repo: P) -> Result<()> { | |||
async fn pull_repo<P: AsRef<Path>>(&self, ctx: &ExecutionContext<'_>, repo: P, verbose: bool) -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need an extra argument here, we can access the --verbose
option through ctx.config().verbose()
|
||
if !verbose { | ||
println!("\n{} updated repositories will be shown...\n", style("Only").green().bold()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda think it is unnecessary to inform users of this on every run, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could go either way. It's somewhat helpful if you have a lot of repositories to know that something is happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's somewhat helpful if you have a lot of repositories to know that something is happening.
i agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx!
…#763) * Add config flag to toggle verbose Git repository output. If `true`: the default, no change. If `false`: Only show repositories that have been updated or have an error. Minor tweak to output (removed colon) so that copy and paste for 'cd' is nicer.
If
true
: the default, no change.If
false
: Only show repositories that have been updated or have an error.Minor tweak to output (removed colon) so that copy and paste for 'cd' is nicer.
Standards checklist:
CONTRIBUTING.md
cargo build
)cargo fmt
)cargo clippy
)cargo test
)For new steps
--dry-run
option works with this step--yes
option works with this step if it is supported bythe underlying command
If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.