Backtestshugorun-20260917-015623#15223
commands: Fix "hugo config --lang" flag help text
Our patch was judged on par with the merged fix.
In this judgment, Patch B = our agent, Patch A = the merged fix.
The two diffs are byte-for-byte identical. Both change the exact same line in commands/config.go from "the language to display config for. Defaults to the first language defined." to "the language to display config for (default is the default content language)", matching the issue's suggested text. Both correctly fix the root cause (the misleading help text that claimed first-by-weight language rather than defaultContentLanguage), both are minimally scoped to the single line, and neither adds tests (reasonable, since this is a documentation-string change not amenable to meaningful automated testing). With no distinguishing feature on correctness, tests, scope, or craft, there is no basis to prefer one over the other.
The judge saw only the two patches, labelled A and B in random order, with issue links and version numbers removed. The reasoning above is shown verbatim.
Solve
3m 26s13 turns
Wall-clock time in the container
Full test suite
No new failures
3,704 passed · 99 skipped · 3,816 total
Contamination audit
Unknown
See the audit notes for this run
Patch size
2vs 2 merged
Changed lines, ours vs merged
The issue
View on GitHubThe --lang flag help says "Defaults to the first language defined", but when
the flag is empty the command uses the default content language:
https://github.com/gohugoio/hugo/blob/master/commands/config.go#L74-L76
These differ when defaultContentLanguage is not first by weight.
Suggested text: "the language to display config for (default is the default content language)"
The two patches
commands/config.goindex 59433b359..d8f20b50b 100644@@ -116,7 +116,7 @@ func (c *configCommand) Init(cd *simplecobra.Commandeer) error { cmd.Long = `Display project configuration, both default and custom settings.` cmd.Flags().StringVar(&c.format, "format", "toml", "preferred file format (toml, yaml or json)") _ = cmd.RegisterFlagCompletionFunc("format", cobra.FixedCompletions([]string{"toml", "yaml", "json"}, cobra.ShellCompDirectiveNoFileComp))- cmd.Flags().StringVar(&c.lang, "lang", "", "the language to display config for. Defaults to the first language defined.")+ cmd.Flags().StringVar(&c.lang, "lang", "", "the language to display config for (default is the default content language)") cmd.Flags().BoolVar(&c.printZero, "printZero", false, `include config options with zero values (e.g. false, 0, "") in the output`) _ = cmd.RegisterFlagCompletionFunc("lang", cobra.NoFileCompletions) applyLocalFlagsBuildConfig(cmd, c.r)
commands/config.goindex 59433b359..d8f20b50b 100644@@ -116,7 +116,7 @@ func (c *configCommand) Init(cd *simplecobra.Commandeer) error { cmd.Long = `Display project configuration, both default and custom settings.` cmd.Flags().StringVar(&c.format, "format", "toml", "preferred file format (toml, yaml or json)") _ = cmd.RegisterFlagCompletionFunc("format", cobra.FixedCompletions([]string{"toml", "yaml", "json"}, cobra.ShellCompDirectiveNoFileComp))- cmd.Flags().StringVar(&c.lang, "lang", "", "the language to display config for. Defaults to the first language defined.")+ cmd.Flags().StringVar(&c.lang, "lang", "", "the language to display config for (default is the default content language)") cmd.Flags().BoolVar(&c.printZero, "printZero", false, `include config options with zero values (e.g. false, 0, "") in the output`) _ = cmd.RegisterFlagCompletionFunc("lang", cobra.NoFileCompletions) applyLocalFlagsBuildConfig(cmd, c.r)
What the agent reported
The reviewer confirmed the substance. The git diff I ran earlier already independently confirmed the change is isolated to that single line in commands/config.go. The AGENTS.md/CLAUDE.md deletions are pre-existing harness scaffolding (present in the session-start git status), not part of this fix.
Summary
What was wrong: In commands/config.go, the --lang flag's help text read "the language to display config for. Defaults to the first language defined." This was inaccurate: when --lang is empty, Run() (line 75) selects the config for conf.configs.Base.DefaultContentLanguage — the default content language — not the first language defined. These differ whenever defaultContentLanguage is not first by weight.
What I changed: A single line — the flag's help string on line 119:
-cmd.Flags().StringVar(&c.lang, "lang", "", "the language to display config for. Defaults to the first language defined.")
+cmd.Flags().StringVar(&c.lang, "lang", "", "the language to display config for (default is the default content language)")
No other production code, and no tests, were touched.
Why no regression test: The fix is a pure help-string correction with no code path or behavior change. Hugo has no tests asserting cobra flag help strings, so a bespoke string-equality test would be brittle and out of keeping with the repo. I judged that stage clearly unnecessary and skipped it.
Test evidence: Ran the container gate (go test -json ./...). The whole repo, including the commands package, compiled successfully — 0 test failures (180 package-level passes; the commands package shows skip only because my -run TestConfig filter matched no test names there, not a build error — a compile failure would surface as a fail action with build output). Reviewer confirmed the new text matches the suggested wording exactly and reflects the actual behavior.
Changes are left uncommitted in the working tree as instructed.