Page MenuHomeFreeBSD

git-arc: Do not echo unescaped literals to jq
AcceptedPublic

Authored by jlduran_gmail.com on Tue, Sep 24, 12:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 9, 12:05 PM
Unknown Object (File)
Tue, Oct 8, 9:50 PM
Unknown Object (File)
Wed, Oct 2, 12:37 PM
Unknown Object (File)
Tue, Oct 1, 2:00 PM
Unknown Object (File)
Tue, Oct 1, 5:22 AM
Unknown Object (File)
Mon, Sep 30, 1:37 PM
Unknown Object (File)
Thu, Sep 26, 1:53 PM
Unknown Object (File)
Thu, Sep 26, 3:33 AM
Subscribers

Details

Reviewers
markj
imp
Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59576
Build 56463: arc lint + arc unit

Event Timeline

I'm not a big fan of making temporary files, but I don't know how else to fix it.

I think this looks good

This revision is now accepted and ready to land.Tue, Sep 24, 12:41 AM

Thank you.. Hmm I am pretty sure I included @emaste in the review. Well, still learning git-arc.

Looks ok to me, thank you.

I think I know how to achieve the same result using printf, and escaping literals with %s.
Regardless, I only have one more patch for git-arc (git arc list) that may benefit of review_data being in a file. If it turns out otherwise, I can "revert" to using variables.
I'm done trying out this great article on the topic.
Thank you for the reviews!

I think I know how to achieve the same result using printf, and escaping literals with %s.
Regardless, I only have one more patch for git-arc (git arc list) that may benefit of review_data being in a file. If it turns out otherwise, I can "revert" to using variables.
I'm done trying out this great article on the topic.
Thank you for the reviews!

I think using files is fine. We don't care about the cost of creating a few extra temporary files here.