HomeFreeBSD

git-arc: Do not echo unescaped literals to jq

Description

git-arc: Do not echo unescaped literals to jq

Store the json blobs in temporary files instead of variables, and feed
them to jq for parsing.

When echoing "\n", the new line will become a literal new line, and
therefore, invalid json input:

jq: parse error: Invalid string: control characters from U+0000 through U+001F must be escaped ...

To reproduce:

% git arc patch -c D12345

Reviewed by: 0mp, imp, markj
Approved by: markj (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D46767

Details

Provenance
jlduranAuthored on Oct 25 2024, 1:20 PM
0mpCommitted on Oct 25 2024, 1:23 PM
Reviewer
0mp
Differential Revision
D46767: git-arc: Do not echo unescaped literals to jq
Parents
rG7d875598fc9f: git-arc: Make patch with reviewers more portable
Branches
Unknown
Tags
Unknown