secret add drops one trailing newline from stdin, secret import stores a file's bytes unchanged, and secret get writes the stored value with no newline added. The README described none of that, so a value ending in a newline, such as a PEM key piped into add, came back one byte shorter with nothing to explain why.
The README entries for secret add, secret get and secret import now state each rule, and the add entry points to import for keeping a file's final newline. A new test in internal/cli/trailing_newline_test.go stores a\n\n through add and through import and checks that add kept two bytes and import three.
The behaviour itself is unchanged, and add gets no option to keep the newline, as the plan on the issue decided.
Deviation: the test cannot fail before this change, since no program code changes; it fails when add is made to keep the newline.
Model: opus-5-5
`secret add` drops one trailing newline from stdin, `secret import` stores a file's bytes unchanged, and `secret get` writes the stored value with no newline added. The README described none of that, so a value ending in a newline, such as a PEM key piped into `add`, came back one byte shorter with nothing to explain why.
The README entries for `secret add`, `secret get` and `secret import` now state each rule, and the `add` entry points to `import` for keeping a file's final newline. A new test in `internal/cli/trailing_newline_test.go` stores `a\n\n` through `add` and through `import` and checks that `add` kept two bytes and `import` three.
The behaviour itself is unchanged, and `add` gets no option to keep the newline, as the plan on the issue decided.
Issue: https://git.eeqj.de/sneak/secret/issues/158
Deviation: the test cannot fail before this change, since no program code changes; it fails when `add` is made to keep the newline.
Model: opus-5-5
`secret add` drops one trailing newline from stdin, so
`echo value | secret add name` stores `value`. `secret import` stores a
file's bytes unchanged, and `secret get` writes the value with no
newline added. The README said none of this, so a PEM key piped into
`add` came back one byte short with no hint why. Its entries for `add`,
`get` and `import` now state each rule. A new test stores `a\n\n`
through `add` and through `import` and checks that `add` kept two bytes
and `import` three. No program code changes.
The new test passes on the code before this change; it fails when `add` keeps the newline.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
secret adddrops one trailing newline from stdin,secret importstores a file's bytes unchanged, andsecret getwrites the stored value with no newline added. The README described none of that, so a value ending in a newline, such as a PEM key piped intoadd, came back one byte shorter with nothing to explain why.The README entries for
secret add,secret getandsecret importnow state each rule, and theaddentry points toimportfor keeping a file's final newline. A new test ininternal/cli/trailing_newline_test.gostoresa\n\nthroughaddand throughimportand checks thataddkept two bytes andimportthree.The behaviour itself is unchanged, and
addgets no option to keep the newline, as the plan on the issue decided.Issue: #158
Deviation: the test cannot fail before this change, since no program code changes; it fails when
addis made to keep the newline.Model: opus-5-5
441b87105etoaa2e8ab97faa2e8ab97fto287f33f386Review passed.
Model: opus-5-5