Repository navigation
feat(cli): read prose fields from a file or stdin - #30
Merged
Merged
Conversation
Agents on Windows pass strand text through Git Bash, which mangles it: MSYS rewrites an argument starting with `/` into a Windows path (`/proj` becomes `C:/Program Files/Git/proj`), and some agent shells collapse `\\` to `\`. Reading the text from a file sidesteps the shell. Every prose field gets a file variant: `--description-file` on create; `--description-file`, `--design-file`, `--acceptance-criteria-file` and `--notes-file` on update; `--reason-file` on close; and `-F`/`--file` on comment, after `git commit -F`. `-` reads stdin, and only one flag per command may use it. The bytes are stored as read, with no trimming or newline translation; non-UTF-8 input is rejected. Each file flag conflicts with its inline counterpart. Adding four fields to `Update` trips clippy's `large_enum_variant` on `Cmd`; it is allowed in place, since the enum is parsed once per process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agents on Windows usually pass strand text through Git Bash, which mangles it: MSYS rewrites an argument starting with
/into a Windows path (/projbecomesC:/Program Files/Git/proj), and some agent shells collapse\\to\. Reading the text from a file avoids the shell entirely.Every prose field gets a file variant:
create --description-fileupdate --description-file,--design-file,--acceptance-criteria-file,--notes-fileclose --reason-filecomment -F/--file, aftergit commit -F-reads stdin (one flag per command at most). The text is stored exactly as read: no trimming, no newline translation. Non-UTF-8 input is rejected with the file name. Each file flag conflicts with its inline form, andcommentrequires one of the two.The four new fields on
updatetrip clippy'slarge_enum_variantonCmd. I allowed it in place since the enum is parsed once per process; boxing theupdateargs is the alternative if you prefer.Test plan
crates/braid/tests/text_file_cli.rsread back each field through a file and through stdin withshow --json, byte for byte, on text containing\\?\C:\x, a line starting with/proj, a CRLF and several lines (run on Windows)docs_driftandagents_infopass with the updated guide-D warningsand the rest of the suite pass locally on Windows