- Show preview and ask for confirmation before git clean unless used with “–force”
- Error out when user tries to pass args such as “guix-clean –help”
guix: Make guix-clean more careful #34776
pull hodlinator wants to merge 1 commits into bitcoin:master from hodlinator:2026/03/guix_clean_destructive changing 1 files +18 −0-
hodlinator commented at 10:12 am on March 9, 2026: contributor
-
DrahtBot added the label Build system on Mar 9, 2026
-
DrahtBot commented at 10:12 am on March 9, 2026: contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviews
See the guideline for information on the review process.
Type Reviewers Stale ACK kevkevinpal, svanstaa If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.
-
hodlinator renamed this:
guix: Make guix-clean less destructive
guix: Make guix-clean more cautious
on Mar 9, 2026 -
hodlinator renamed this:
guix: Make guix-clean more cautious
guix: Make guix-clean more careful
on Mar 9, 2026 -
willcl-ark commented at 10:18 am on March 9, 2026: memberI am using
guix-cleanin scripts, and I think this would the ability to do that. I would prefer, if we make this change, to also accept a--forceor-yflag which means my automation would still be able to clean automagically :) -
hodlinator marked this as a draft on Mar 9, 2026
-
hodlinator commented at 10:21 am on March 9, 2026: contributorThanks for the feedback, will rework it.
-
hodlinator force-pushed on Mar 9, 2026
-
DrahtBot added the label CI failed on Mar 9, 2026
-
hodlinator force-pushed on Mar 9, 2026
-
hodlinator marked this as ready for review on Mar 9, 2026
-
hodlinator commented at 10:53 am on March 9, 2026: contributorNow supports non-interactive scripts through “–force” in response to #34776 (comment).
-
hodlinator force-pushed on Mar 9, 2026
-
DrahtBot removed the label CI failed on Mar 9, 2026
-
kevkevinpal commented at 3:43 pm on March 9, 2026: contributorA good follow-up would be to add a
--exclude-diror--excludeoption to ignore specific files/directories -
kevkevinpal commented at 3:45 pm on March 9, 2026: contributor
tACK beb87b9
Was able to test that both
--forceand the promt for yes or no worked.I like the addition of the dry run to explain what is going to be deleted aswell
-
sedited commented at 5:14 pm on March 9, 2026: contributorSeems fine, I think the first time I ran the script I was also confused about what it actually removes.
-
svanstaa commented at 6:44 pm on March 9, 2026: none
tACK beb87b9
Tested:
- unknown argument gets rejected
- prompt for y works as expected
- prompt for n aborts the script
- argument –force works
Nit: line 91 uses single brackets which is inconsistent with the double brackets used elsewhere. Since the script is bash-only, I suggest using
[[ ]]throughout:0if [[ $FORCE == 0 ]]; thenAlso, before I was not aware that guix-clean actually nukes all untracked files in the whole Bitcoin repo, not just the Guix build artifacts! So the name is a bit misleading. Good call to warn the user before about what exactly will be deleted.
-
be6d24ec22
guix: Make guix-clean less destructive
* Show preview and ask for confirmation before git clean unless used with "--force" * Error out when trying to pass args such as "guix-clean --help"
-
hodlinator force-pushed on Mar 9, 2026
-
hodlinator commented at 7:23 pm on March 9, 2026: contributor
Nit: line 91 uses single brackets which is inconsistent with the double brackets used elsewhere. Since the script is bash-only, I suggest using
[[ ]]throughout:Aargh, I couldn’t live with this inconsistency - fixed in latest push. Double brackets indeed seem like the way to go. Thanks for spotting!
A good follow-up would be to add a
--exclude-diror--excludeoption to ignore specific files/directoriesIndeed, that would be useful. Would be tempting to switch to Python argparse for that though. With this PR as it is currently, one can just abort after the preview and manually
rm -rf <copied> <subset> <from> <preview> <list>.
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-10 09:13 UTC
More mirrored repositories can be found on mirror.b10c.me