feat: byte-driven BLAKE3 hashing progress bar, TTY detection & --quiet flag#67
Merged
Conversation
Contributor
Author
|
Hi @Rakshat28 👋
Happy to address any feedback! 🚀 |
Owner
|
Please change README.md to reflect the addition of the --quiet flag @Itzzavdheshh |
Repository owner
deleted a comment from
Itzzavdheshh
May 24, 2026
Repository owner
deleted a comment from
Itzzavdheshh
May 24, 2026
Repository owner
deleted a comment from
Itzzavdheshh
May 24, 2026
Contributor
Author
|
wow @Rakshat28 , thanku for your kind whatsapp message , i think we should not be working together .... i request you to close this PR unmerged and unassign me from your remaining issues ... its been great working with you , Thanku |
Added documentation for global flags in README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Related Issue
Fixes #46
📝 Description
🔹 What has been changed?
src/hasher.rsQUIETAtomicBooladded withset_quiet()andis_quiet()helpers — worker threads read it directly, no state propagation neededfull_hash()updated to acceptOption<&indicatif::ProgressBar>— bar advanced by exact bytes read per chunk:sparse_hash()signature left unchanged — small files (≤12KB) that fall back to full hashing internally are excluded from progress bar to prevent double-countingsrc/main.rs-q/--quietCLI flag added via Clap derive API — documented in customGLOBAL FLAGShelp templatestd::io::IsTerminalcheck onstdout— non-TTY (piped) automatically activates quiet mode; zero ANSI pollution in pipesbyte_progress()helper builds bar withProgressDrawTarget::stderr()+{bytes}/{total_bytes} ({bytes_per_sec}, {eta})templatescan_pipelineaccumulates total bytes dynamically as duplicate candidates are identified — bar length set in bytes not file countProgressBar::hidden()when quiet or non-TTY stdout detectedprogresshelper function removed — zero dead code warningstests/integration_tests.rstest_quiet_suppresses_progress_output— verifies-qproduces no stderr progress output while asserting command successtest_nontty_stdout_suppresses_progress_output— verifies piped execution auto-suppresses all progress rendering🔹 Why are these changes needed?
\rsequences to stdout — piped commands likebdstorage dedupe /path | grep somethingproduced garbled, unparseable output--quietflag was entirely absent🛠️ Type of Change
🧪 Testing
cargo fmt --check cargo clippy --all-targets --all-features -- -D warnings cargo test✅ Tests Performed
cargo fmt --check— passes clean, zero violationscargo test— 17/17 tests pass including 2 new integration testsbdstorage dedupe /path | grep something— clean output, zero garbled\rsequences-qflag — all progress output suppressed, command exits successfullysparse_hashexcluded from bar correctly🌐 Browsers Tested
N/A — CLI tool
📷 Screenshots / Demo
1. Before — full-hash stage runs silently, tool appears hung

2. After — byte-driven progress bar with MB/s throughput and ETA

3. Bar disappears cleanly on completion

4.

bdstorage dedupe /path | grep something— clean output, zero ANSI pollution5.

-qflag — zero progress output on stderr6.

cargo test— 17/17 tests passing including new integration tests📋 Checklist
ProgressDrawTarget::stderr()— stdout untouched-q/--quietflag suppresses all progress output globallysparse_hashexcluded from bar — no double-counting on≤12KBfilesQUIETstored asAtomicBool— thread-safe, no complex state propagationcargo fmt --check— passcargo test— 17/17 passprogresshelper removed — zero dead code warningsdedupeandscanbehaviour completely unchanged💬 Additional Notes
AtomicBoolforQUIET? Worker threads in the hashing pool need to check quiet state without locks orArcpassing — a global atomic is the idiomatic Rust pattern for this.stderrfor progress? stdout must stay clean for piping.ProgressDrawTarget::stderr()is the standardindicatifpattern — progress never touches stdout.🙌 Contribution Note
Hi @Rakshat28 👋
--quietflag added — scripts and CI can fully silence progress outputsparse_hashcorrectly excluded from barHappy to address any feedback! 🚀
🏷️ Labels
#feature#cli#rust#progress-bar#indicatif#blake3#tty#quiet-mode#integration-tests#NSoC26#nsoc#GSSOCSubmitted as part of Open Source Contribution — NSoC (Nexus Spring of Code) & GSSoC