Skip to content

du: only warn when -s is given with --max-depth=0 - #16687

Open
Xnadir wants to merge 1 commit into
uutils:mainfrom
Xnadir:du-summarize-depth-zero
Open

Xnadir wants to merge 1 commit into
uutils:mainfrom
Xnadir:du-summarize-depth-zero

Conversation

@Xnadir

@Xnadir Xnadir commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

du -s --max-depth=0 FILE failed with summarizing conflicts with --max-depth=0. GNU accepts it, prints du: warning: summarizing is the same as using --max-depth=0 and goes on (this is the du note at the end of #16646). Any other depth still conflicts with -s.

The depth is now validated before the -s check, so du -s --max-depth=abc reports invalid maximum depth 'abc' like GNU, instead of the conflict.

The new test covers -s --max-depth=0, -d 0 -s, -s --max-depth=1 and -s --max-depth=abc; it fails on main. I added the warning to the en-US and fr-FR locales.

Refs #16646

AI disclosure: written with help from Claude Code.

Copilot AI balanced review requested due to automatic review settings November 18, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

This branch has not been deployed

No deployments
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.

2 participants