Skip to content
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

Combining --progress and --replay deletes hashes in rmlint.json #581

Open
mb720 opened this issue Aug 5, 2022 · 1 comment · May be fixed by #582
Open

Combining --progress and --replay deletes hashes in rmlint.json #581

mb720 opened this issue Aug 5, 2022 · 1 comment · May be fixed by #582
Labels

Comments

@mb720
Copy link

mb720 commented Aug 5, 2022

Hi and thanks for rmlint!

I was surprised by the behavior of this command:

rmlint --progress -c sh:link --replay rmlint.json .

I expected that rmlint would reuse the existing rmlint.json and create a rmlint.replay.sh that makes hardlinks out of duplicate files. And report a bit of progress while doing so.

Instead, both rmlint.json and rmlint.sh got overwritten with nearly empty files. The hashes are gone from rmlint.json.

I wasn't sure what was wrong and didn't expect that the innocuous looking --progress option was causing trouble. But it was. Removing --progress made rmlint behave as I wanted:

rmlint -c sh:link --replay rmlint.json .

I somehow suspect this behavior is a bug since rmlint overwrites data without warning and it doesn't seem to be documented in the man page.

I'm using rmlint 2.10.1 on Arch Linux, compile features are according to rmlint --version

compiled with: +mounts +nonstripped +fiemap +sha512 +bigfiles +intl +replay +xattr +btrfs-support

@cebtenzzre
Copy link
Collaborator

This isn't explicitly documented, but it is subtly implied by the way --progress is described in the manpage:

Convenience shortcut for -o progressbar -o summary -o sh:rmlint.sh -o json:rmlint.json -VV.

Note the explicit -o sh:rmlint.sh -o json:rmlint.json.

-o clears the default outputs, which are different in replay mode. But --progress still allows you to override the sh/json outputs individually.

I agree that this behavior is confusing, and I am preparing a pull request that simplifies the option.

cebtenzzre added a commit to cebtenzzre/rmlint that referenced this issue Aug 5, 2022
The behavior of --progress could be surprising, especially when combined
with --replay. Simplify its meaning and make sure the docs describe it
accurately.

Fixes sahib#581
@cebtenzzre cebtenzzre linked a pull request Aug 6, 2022 that will close this issue
@mb720 mb720 changed the title Combinining --progress and --replay deletes hashes in rmlint.json Combining --progress and --replay deletes hashes in rmlint.json Aug 6, 2022
cebtenzzre added a commit to cebtenzzre/rmlint that referenced this issue Aug 7, 2022
The behavior of --progress could be surprising, especially when combined
with --replay. Simplify its meaning and make sure the docs describe it
accurately.

Fixes sahib#581
@cebtenzzre cebtenzzre linked a pull request Aug 9, 2022 that will close this issue
@cebtenzzre cebtenzzre removed the has-pr label Aug 9, 2022
cebtenzzre added a commit to cebtenzzre/rmlint that referenced this issue Sep 18, 2022
The behavior of --progress could be surprising, especially when combined
with --replay. Simplify its meaning and make sure the docs describe it
accurately.

Fixes sahib#581
intelfx pushed a commit to intelfx/rmlint that referenced this issue Mar 9, 2023
The behavior of --progress could be surprising, especially when combined
with --replay. Simplify its meaning and make sure the docs describe it
accurately.

Fixes sahib#581
intelfx pushed a commit to intelfx/rmlint that referenced this issue Mar 9, 2023
The behavior of --progress could be surprising, especially when combined
with --replay. Simplify its meaning and make sure the docs describe it
accurately.

Fixes sahib#581
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants