Skip to content

fix: quote a --flag=value from the equals sign, not from the start - #5

Merged
MY-RV merged 1 commit into
mainfrom
fix/flag-value-quoting
Sep 21, 2026
Merged

MY-RV merged 1 commit into
mainfrom
fix/flag-value-quoting

Conversation

@MY-RV

@MY-RV MY-RV commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

A shell hands godo one argument, so --am="two words" arrives whole and was quoted whole:

$ godo --preview commit --am="two words"
git commit '--am=two words'     # before — reads as if the flag name were part of the message
git commit --am='two words'     # after

Same single argument to the shell. A test runs both through sh and asserts the argument that arrives is byte-identical, so this is a rendering change and nothing more.

Only applies when the prefix is a real flag (-f= / --flag=) and inert on its own — am=two words and --=x y are still quoted whole. --am-two words has no delimiter to split on and is left alone: = is a delimiter, - is not.

First of a two-PR stack; #runner-axis builds on this.

Checklist

  • Behavior change? Update docs/contract.md in the same PR
  • Tests cover the change (happy path + edge)
  • ./godo ci passes locally
  • No drive-by refactors

A shell hands godo one argument, so --am="two words" arrives whole and was
quoted whole: git commit '--am=two words'. That reads as though the flag name
were part of the message, which is a bad look for a tool whose feature is
showing you the command before it runs.

Quoting only the value — --am='two words' — is the same single argument to the
shell and is what a person would have typed. A test runs both through sh and
asserts the argument that arrives is byte-identical, so this stays a rendering
change and nothing more.

Only applies when the prefix is a real flag (-f= / --flag=) and inert on its
own; 'am=two words' and '--=x y' are still quoted whole. A value like
'--am-two words' has no delimiter to split on and is left alone — '=' is a
delimiter, '-' is not, and inventing a split point would be godo inventing
structure that is not there.
@MY-RV
MY-RV merged commit 3a55653 into main Sep 21, 2026
4 checks passed
@MY-RV
MY-RV deleted the fix/flag-value-quoting branch September 21, 2026 04:01
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.

1 participant