neovim / go-client

Nvim Go client
https://pkg.go.dev/github.com/neovim/go-client
Apache License 2.0
578 stars 36 forks source link

Fixing issue with BufferLines Unpack when there are a lot of long lines #32

Closed vito-c closed 6 years ago

vito-c commented 6 years ago

I was playing around with reading lines from a buffer and ran into a parsing error. Specifically I was getting this error msgpack: cannot convert Int to []uint8 and only part of one of the lines was being read.

I am also going to include the test file I used so you can run any tests you'd like.

vito-c commented 6 years ago

Here is some test data. Github wouldn't let me upload the file so I just pasted the json.

Show huge json file

``` [ { "url": "https://api.github.com/repos/stedolan/jq/issues/1033", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/1033/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/1033/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/1033/events", "html_url": "https://github.com/stedolan/jq/issues/1033", "id": 120139524, "number": 1033, "title": "jq hangs with 100% CPU", "user": { "login": "yurivict", "id": 271906, "avatar_url": "https://avatars.githubusercontent.com/u/271906?v=3", "gravatar_id": "", "url": "https://api.github.com/users/yurivict", "html_url": "https://github.com/yurivict", "followers_url": "https://api.github.com/users/yurivict/followers", "following_url": "https://api.github.com/users/yurivict/following{/other_user}", "gists_url": "https://api.github.com/users/yurivict/gists{/gist_id}", "starred_url": "https://api.github.com/users/yurivict/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yurivict/subscriptions", "organizations_url": "https://api.github.com/users/yurivict/orgs", "repos_url": "https://api.github.com/users/yurivict/repos", "events_url": "https://api.github.com/users/yurivict/events{/privacy}", "received_events_url": "https://api.github.com/users/yurivict/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/bug", "name": "bug", "color": "e11d21" } ], "state": "open", "locked": false, "assignee": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "milestone": null, "comments": 9, "created_at": "2015-12-03T10:32:05Z", "updated_at": "2015-12-04T02:26:01Z", "closed_at": null, "body": "This script hangs\r\n```\r\n#!/bin/sh\r\n\r\njq -s '((.[0][\"packageDependencies\"] | with_entries({key:(.key), value:(.value|gsub(\"(.*)\";\"\\\\1\"; \"x\"))})) | {packageDependencies:.})' package1.json\r\n```\r\nwhen run on this package1.json\r\n```\r\n{\r\n \"packageDependencies\": {\r\n \"language-yaml\": \"0.24.1\"\r\n }\r\n}\r\n```\r\n\r\nSince jq is supposed to work in a stream fashion, I don't think it should ever enter the endless cycle.\r\n\r\njq-1.5 on FreeBSD-10.2" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/1032", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/1032/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/1032/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/1032/events", "html_url": "https://github.com/stedolan/jq/pull/1032", "id": 119871577, "number": 1032, "title": "Dump block", "user": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "labels": [ ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 10, "created_at": "2015-12-02T05:41:47Z", "updated_at": "2015-12-03T15:45:33Z", "closed_at": null, "pull_request": { "url": "https://api.github.com/repos/stedolan/jq/pulls/1032", "html_url": "https://github.com/stedolan/jq/pull/1032", "diff_url": "https://github.com/stedolan/jq/pull/1032.diff", "patch_url": "https://github.com/stedolan/jq/pull/1032.patch" }, "body": "This is a work in progress. We'll need a new jq compile function to take the dump_block option. Or we could overload the existing `jq_compile_args()` `args` argument to accept special arguments (ones whose names are not valid identifiers). I vote for a new function. Comments?" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/1027", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/1027/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/1027/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/1027/events", "html_url": "https://github.com/stedolan/jq/issues/1027", "id": 119359020, "number": 1027, "title": "Error messages should contain column numbers", "user": { "login": "yurivict", "id": 271906, "avatar_url": "https://avatars.githubusercontent.com/u/271906?v=3", "gravatar_id": "", "url": "https://api.github.com/users/yurivict", "html_url": "https://github.com/yurivict", "followers_url": "https://api.github.com/users/yurivict/followers", "following_url": "https://api.github.com/users/yurivict/following{/other_user}", "gists_url": "https://api.github.com/users/yurivict/gists{/gist_id}", "starred_url": "https://api.github.com/users/yurivict/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yurivict/subscriptions", "organizations_url": "https://api.github.com/users/yurivict/orgs", "repos_url": "https://api.github.com/users/yurivict/repos", "events_url": "https://api.github.com/users/yurivict/events{/privacy}", "received_events_url": "https://api.github.com/users/yurivict/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/feature%20request", "name": "feature request", "color": "207de5" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 0, "created_at": "2015-11-29T12:48:49Z", "updated_at": "2015-11-29T17:06:55Z", "closed_at": null, "body": "Message like this\r\n```\r\njq: error: syntax error, unexpected INVALID_CHARACTER (Unix shell quoting issues?) at , line 1:\r\n```\r\ncan become more informative if column number was included. Please note that modern compilers, like clang, print columns in error messages.\r\n" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/1026", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/1026/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/1026/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/1026/events", "html_url": "https://github.com/stedolan/jq/issues/1026", "id": 119271630, "number": 1026, "title": "Better errors needed for {IDENT:Exp}", "user": { "login": "ssimeonov", "id": 491953, "avatar_url": "https://avatars.githubusercontent.com/u/491953?v=3", "gravatar_id": "", "url": "https://api.github.com/users/ssimeonov", "html_url": "https://github.com/ssimeonov", "followers_url": "https://api.github.com/users/ssimeonov/followers", "following_url": "https://api.github.com/users/ssimeonov/following{/other_user}", "gists_url": "https://api.github.com/users/ssimeonov/gists{/gist_id}", "starred_url": "https://api.github.com/users/ssimeonov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ssimeonov/subscriptions", "organizations_url": "https://api.github.com/users/ssimeonov/orgs", "repos_url": "https://api.github.com/users/ssimeonov/repos", "events_url": "https://api.github.com/users/ssimeonov/events{/privacy}", "received_events_url": "https://api.github.com/users/ssimeonov/received_events", "type": "User", "site_admin": false }, "labels": [ ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 1, "created_at": "2015-11-28T05:17:58Z", "updated_at": "2015-11-30T20:45:37Z", "closed_at": null, "body": "The following behavior is not intuitive.\r\n\r\n```bash\r\n➜ jq -n -c '{\"x\": (100*100)}'\r\n{\"x\":10000}\r\n➜ jq -n -c '{\"x\": 100*100}'\r\njq: error: syntax error, unexpected '*', expecting '}' (Unix shell quoting issues?) at , line 1:\r\n{\"x\": 100*100}\r\njq: 1 compile error\r\n```" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/1025", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/1025/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/1025/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/1025/events", "html_url": "https://github.com/stedolan/jq/issues/1025", "id": 119242832, "number": 1025, "title": "Script Files", "user": { "login": "vito-c", "id": 820137, "avatar_url": "https://avatars.githubusercontent.com/u/820137?v=3", "gravatar_id": "", "url": "https://api.github.com/users/vito-c", "html_url": "https://github.com/vito-c", "followers_url": "https://api.github.com/users/vito-c/followers", "following_url": "https://api.github.com/users/vito-c/following{/other_user}", "gists_url": "https://api.github.com/users/vito-c/gists{/gist_id}", "starred_url": "https://api.github.com/users/vito-c/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vito-c/subscriptions", "organizations_url": "https://api.github.com/users/vito-c/orgs", "repos_url": "https://api.github.com/users/vito-c/repos", "events_url": "https://api.github.com/users/vito-c/events{/privacy}", "received_events_url": "https://api.github.com/users/vito-c/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/contribution", "name": "contribution", "color": "d4c5f9" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 38, "created_at": "2015-11-27T20:16:21Z", "updated_at": "2015-12-03T00:06:00Z", "closed_at": null, "body": "What is the filetype extension for script files? I was thinking of making a syntax highlighting file " }, { "url": "https://api.github.com/repos/stedolan/jq/issues/1008", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/1008/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/1008/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/1008/events", "html_url": "https://github.com/stedolan/jq/issues/1008", "id": 114452793, "number": 1008, "title": "extension of jq_compile_args using str_length arg instead of requiring null-terminated str", "user": { "login": "mewalig", "id": 8260442, "avatar_url": "https://avatars.githubusercontent.com/u/8260442?v=3", "gravatar_id": "", "url": "https://api.github.com/users/mewalig", "html_url": "https://github.com/mewalig", "followers_url": "https://api.github.com/users/mewalig/followers", "following_url": "https://api.github.com/users/mewalig/following{/other_user}", "gists_url": "https://api.github.com/users/mewalig/gists{/gist_id}", "starred_url": "https://api.github.com/users/mewalig/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mewalig/subscriptions", "organizations_url": "https://api.github.com/users/mewalig/orgs", "repos_url": "https://api.github.com/users/mewalig/repos", "events_url": "https://api.github.com/users/mewalig/events{/privacy}", "received_events_url": "https://api.github.com/users/mewalig/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/libjq", "name": "libjq", "color": "fbca04" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 4, "created_at": "2015-11-01T05:53:36Z", "updated_at": "2015-11-19T05:17:41Z", "closed_at": null, "body": "Hi, \r\n\r\nMinor request: could you provide a version of jq_compile_args that does not require a null-terminated string for its second argument and instead accepts as an additional argument an int (or variant thereof) that provides the length of str? e.g.:\r\n```\r\nint jq_compile_args(jq_state *jq, const char* str, jv args) {\r\n return jq_compile_args_2(jq, str, strlen(str), args);\r\n}\r\n\r\nint jq_compile_args_2(jq_state *jq, const char* str, unsigned int str_length, jv args) {\r\n...\r\n}\r\n```\r\nseems like an easy change since it would just mean replacing the strlen(str) call with the new str_length arg. I hate using a copy of a const char *string unnecessarily, and this would save that hassle for me, and hopefully for others as well, when dealing with non-null-terminated string data." }, { "url": "https://api.github.com/repos/stedolan/jq/issues/1007", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/1007/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/1007/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/1007/events", "html_url": "https://github.com/stedolan/jq/issues/1007", "id": 114214926, "number": 1007, "title": "Cross compilation page corrections / improvements", "user": { "login": "mewalig", "id": 8260442, "avatar_url": "https://avatars.githubusercontent.com/u/8260442?v=3", "gravatar_id": "", "url": "https://api.github.com/users/mewalig", "html_url": "https://github.com/mewalig", "followers_url": "https://api.github.com/users/mewalig/followers", "following_url": "https://api.github.com/users/mewalig/following{/other_user}", "gists_url": "https://api.github.com/users/mewalig/gists{/gist_id}", "starred_url": "https://api.github.com/users/mewalig/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mewalig/subscriptions", "organizations_url": "https://api.github.com/users/mewalig/orgs", "repos_url": "https://api.github.com/users/mewalig/repos", "events_url": "https://api.github.com/users/mewalig/events{/privacy}", "received_events_url": "https://api.github.com/users/mewalig/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/build", "name": "build", "color": "eb6420" } ], "state": "open", "locked": false, "assignee": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "milestone": null, "comments": 1, "created_at": "2015-10-30T07:07:41Z", "updated_at": "2015-10-30T15:06:16Z", "closed_at": null, "body": "Couple corrections/clarifications to the cross compilation wiki (https://github.com/stedolan/jq/wiki/Cross-compilation), at least for building the Win64 static lib binaries from OSX:\r\n\r\n* the prefix should not end with \"lib\" in the following line:\r\n```\r\n./configure --target=win64-x86_64 --host=x86_64-w64-mingw32 --prefix=/home/build/proto/win64/usr/local/lib\r\n```\r\n* The Makefile that is created in build/win64/tmp needs a couple of tweaks:\r\n * DEFAULT_INCLUDES needs to also have -I/path/to/build/win64/tmp/src in order to find version.h\r\n * libjq_la_LIBADD needs to also have -lshlwapi in order to find PathIsRelativeA\r\n\r\nOnce those were addressed the build worked, at least for a static lib" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/1006", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/1006/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/1006/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/1006/events", "html_url": "https://github.com/stedolan/jq/issues/1006", "id": 113764557, "number": 1006, "title": "Download page: add reference to https://copr.fedoraproject.org/coprs/fabio/jq", "user": { "login": "fabio-porcedda", "id": 1491907, "avatar_url": "https://avatars.githubusercontent.com/u/1491907?v=3", "gravatar_id": "", "url": "https://api.github.com/users/fabio-porcedda", "html_url": "https://github.com/fabio-porcedda", "followers_url": "https://api.github.com/users/fabio-porcedda/followers", "following_url": "https://api.github.com/users/fabio-porcedda/following{/other_user}", "gists_url": "https://api.github.com/users/fabio-porcedda/gists{/gist_id}", "starred_url": "https://api.github.com/users/fabio-porcedda/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fabio-porcedda/subscriptions", "organizations_url": "https://api.github.com/users/fabio-porcedda/orgs", "repos_url": "https://api.github.com/users/fabio-porcedda/repos", "events_url": "https://api.github.com/users/fabio-porcedda/events{/privacy}", "received_events_url": "https://api.github.com/users/fabio-porcedda/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/site", "name": "site", "color": "5319e7" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 0, "created_at": "2015-10-28T08:10:25Z", "updated_at": "2015-11-18T07:44:26Z", "closed_at": null, "body": "The latest version is avaiable only on the unreleased Fedora 23\r\n\r\nAdd reference to the copr repository with the latest version rebuilt for Fedora 21 and Fedora 22.\r\n\r\nTo enable it use the command:\r\n sudo dnf copr enable fabio/jq\r\n\r\nThanks\r\nFabio Porcedda" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/1005", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/1005/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/1005/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/1005/events", "html_url": "https://github.com/stedolan/jq/pull/1005", "id": 113727320, "number": 1005, "title": "C coded generators (explodes, readfile, _popenr)", "user": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/feature%20request", "name": "feature request", "color": "207de5" } ], "state": "open", "locked": false, "assignee": null, "milestone": { "url": "https://api.github.com/repos/stedolan/jq/milestones/7", "html_url": "https://github.com/stedolan/jq/milestones/1.6%20release", "labels_url": "https://api.github.com/repos/stedolan/jq/milestones/7/labels", "id": 882049, "number": 7, "title": "1.6 release", "description": "", "creator": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "open_issues": 29, "closed_issues": 8, "state": "open", "created_at": "2014-11-26T23:57:47Z", "updated_at": "2015-10-28T02:11:40Z", "due_on": null, "closed_at": null }, "comments": 12, "created_at": "2015-10-28T02:05:37Z", "updated_at": "2015-11-01T22:44:18Z", "closed_at": null, "pull_request": { "url": "https://api.github.com/repos/stedolan/jq/pulls/1005", "html_url": "https://github.com/stedolan/jq/pull/1005", "diff_url": "https://github.com/stedolan/jq/pull/1005.diff", "patch_url": "https://github.com/stedolan/jq/pull/1005.patch" }, "body": "NOTE: NOT DONE YET.\r\n\r\nThis is just a proof of concept. I'm able to read files, read from commands.\r\n\r\nTODO:\r\n\r\n - DONE: Implement @stedolan's comments regarding C-coded generators.\r\n - Make a nice jq-coded wrapper around `_popenr`\r\n - NOT NOW: Add an argument array input version of `_popenr` (an arg-vector form should use posix_spawn(), or spawn() on Windows, and bypass the shell)\r\n - Figure out how to handle raw vs. parsed vs. streamed, slurped vs. not.\r\n - A separate builtin for each case? (that's six cases, so six file reading builtins, six popen reading builtins, ...)\r\n - Or one that takes an input describing what's desired?\r\n - Or always read a line at a time, raw, and output strings with the newline (so that a final read without a newline could be denoted)? The caller could slurp and/or parse as desired. But what if the file has no newlines and is huge? Incremental parsing seems like a much better option.\r\n - Implement privilege management design discussed earlier\r\n - A command-line option for enabling privileges for specific modules\r\n - Unprivileged versions of `readfile` and `_popenr` that raise an `error`\r\n - And, of course, increase test coverage (tests are missing; it's early days)\r\n\r\nMore importantly, how to handle something like `writefile(EXP)` or `popen(EXP)`? Even C-coded generators can't call jq expressions. So that means having file handles. We can avoid those for `readfile`. We've discussed how to do filehandles in a way that doesn't leak handles out, doesn't allow callers to slip in an incorrect handle, and doesn't have a dangling reference problem: make the C-coded functions to open/close handles and read from / write to handles be available only to privileged jq-coded functions that will use them in such a way as to never leak them:\r\n\r\n def writefile(exp):\r\n openfile_write as $handle | try (exp | filehandle_write) catch ($handle|filehandle_close), error;\r\n\r\n((Food for though: Some day it would be nice to be able to C-coded functions that take closure arguments. I imagine setting up a trampoline in the VM for a C-coded function to call a closure argument, but to avoid filling the C call stack the C-coded function would have to immediately return and get called again with the closure's output(s); state would be kept in a state structure pointed to by the C-coded function's jq VM frame. Calling closures in separate VMs could also be done, but arranging for them to be able to access their captured variables would be tricky. With such an extension there'd be no need for handles for simple I/O builtins.))\r\n\r\nWe'll still need handles, and ones that are exposed to jq callers, for co-routines, so we might want to bite this bullet sooner rather than later. I have an old branch with file handle support for the jq VM that I could revive. Still, for simple I/O builtins, we don't need to expose a concept of handles, and that seems appealing." }, { "url": "https://api.github.com/repos/stedolan/jq/issues/1003", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/1003/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/1003/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/1003/events", "html_url": "https://github.com/stedolan/jq/issues/1003", "id": 113684639, "number": 1003, "title": "make afl target", "user": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/test", "name": "test", "color": "eb6420" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 0, "created_at": "2015-10-27T20:42:49Z", "updated_at": "2015-11-19T05:30:10Z", "closed_at": null, "body": "AFL is fabulous. Among many bugs it's found in many projects, it's found a handful of bugs in jq. We should have a way to run AFL to fuzz jq. There's a dumb fuzzer in jq's tests that has found bugs during development, but AFL would be a good addition anyways, as there are things it can do that the dumb fuzzer we have just can't." }, { "url": "https://api.github.com/repos/stedolan/jq/issues/1001", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/1001/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/1001/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/1001/events", "html_url": "https://github.com/stedolan/jq/issues/1001", "id": 113431864, "number": 1001, "title": "jq Download page claim 1.5 is available in Debian and Ubuntu repos; is actually 1.4 or less", "user": { "login": "nfirvine", "id": 7578, "avatar_url": "https://avatars.githubusercontent.com/u/7578?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nfirvine", "html_url": "https://github.com/nfirvine", "followers_url": "https://api.github.com/users/nfirvine/followers", "following_url": "https://api.github.com/users/nfirvine/following{/other_user}", "gists_url": "https://api.github.com/users/nfirvine/gists{/gist_id}", "starred_url": "https://api.github.com/users/nfirvine/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nfirvine/subscriptions", "organizations_url": "https://api.github.com/users/nfirvine/orgs", "repos_url": "https://api.github.com/users/nfirvine/repos", "events_url": "https://api.github.com/users/nfirvine/events{/privacy}", "received_events_url": "https://api.github.com/users/nfirvine/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/site", "name": "site", "color": "5319e7" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 2, "created_at": "2015-10-26T19:23:38Z", "updated_at": "2015-11-18T07:43:22Z", "closed_at": null, "body": "In Ubuntu:\r\n\r\n```\r\nprecise-backports (utils): lightweight and flexible command-line JSON processor [universe] \r\n1.2-8~ubuntu12.04.1: amd64 i386\r\ntrusty (14.04LTS) (utils): lightweight and flexible command-line JSON processor [universe] \r\n1.3-1.1ubuntu1: amd64 i386\r\ntrusty-backports (utils): lightweight and flexible command-line JSON processor [universe] \r\n1.4-2.1~ubuntu14.04.1: amd64 i386\r\nutopic (utils): lightweight and flexible command-line JSON processor [universe] \r\n1.4-2.1: amd64 i386\r\nvivid (utils): lightweight and flexible command-line JSON processor [universe] \r\n1.4-2.1: amd64 i386\r\nwily (utils): lightweight and flexible command-line JSON processor [universe] \r\n1.4-2.1: amd64 i386\r\n```\r\n\r\nIn Debian,\r\n```\r\nwheezy-backports (utils): lightweight and flexible command-line JSON processor \r\n1.4-1~bpo70+1: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390x\r\njessie (stable) (utils): lightweight and flexible command-line JSON processor \r\n1.4-2.1+b1: s390x \r\n1.4-2.1: amd64 arm64 armel armhf i386 mips mipsel powerpc ppc64el\r\nstretch (testing) (utils): lightweight and flexible command-line JSON processor \r\n1.4-2.1+b1: s390x \r\n1.4-2.1: amd64 arm64 armel armhf i386 mips mipsel powerpc ppc64el\r\nsid (unstable) (utils): lightweight and flexible command-line JSON processor \r\n1.5+dfsg-1: alpha amd64 arm64 armel armhf hppa hurd-i386 i386 kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 ppc64el s390x \r\n1.4-2.1 [debports]: mips mipsel sh4\r\n```" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/994", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/994/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/994/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/994/events", "html_url": "https://github.com/stedolan/jq/issues/994", "id": 112015960, "number": 994, "title": "jq 1.5 FTBFS on MIPS", "user": { "login": "else", "id": 77769, "avatar_url": "https://avatars.githubusercontent.com/u/77769?v=3", "gravatar_id": "", "url": "https://api.github.com/users/else", "html_url": "https://github.com/else", "followers_url": "https://api.github.com/users/else/followers", "following_url": "https://api.github.com/users/else/following{/other_user}", "gists_url": "https://api.github.com/users/else/gists{/gist_id}", "starred_url": "https://api.github.com/users/else/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/else/subscriptions", "organizations_url": "https://api.github.com/users/else/orgs", "repos_url": "https://api.github.com/users/else/repos", "events_url": "https://api.github.com/users/else/events{/privacy}", "received_events_url": "https://api.github.com/users/else/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/bug", "name": "bug", "color": "e11d21" }, { "url": "https://api.github.com/repos/stedolan/jq/labels/portability", "name": "portability", "color": "006b75" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 5, "created_at": "2015-10-18T12:06:16Z", "updated_at": "2015-10-24T07:13:22Z", "closed_at": null, "body": "The 1.5 version [fails to build from scratch](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=802208) on MIPS*. The bug report contains the [test-suite.log](https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=3;att=1;bug=802208;filename=test-suite.log):\r\n\r\n

\r\n========================================\r\n   jq 1.5-1-a5b5cbe: ./test-suite.log\r\n========================================\r\n\r\n# TOTAL: 4\r\n# PASS:  0\r\n# SKIP:  0\r\n# XFAIL: 0\r\n# FAIL:  4\r\n# XPASS: 0\r\n# ERROR: 0\r\n\r\n.. contents:: :depth: 2\r\n\r\nFAIL: tests/mantest\r\n===================\r\n\r\nSegmentation fault\r\nrake aborted!\r\nErrno::EPIPE: Broken pipe @ io_write - \r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:50:in `write'\r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:50:in `puts'\r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:50:in `puts'\r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:50:in `block (5 levels) in '\r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:50:in `each'\r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:50:in `block (4 levels) in '\r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:47:in `each'\r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:47:in `block (3 levels) in '\r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:46:in `each'\r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:46:in `block (2 levels) in '\r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:45:in `each'\r\n/home/jwilk/jq-1.5+dfsg/docs/Rakefile:45:in `block in '\r\nTasks: TOP => mantests\r\n(See full trace by running task with --trace)\r\nFAIL tests/mantest (exit status: 139)\r\n\r\nFAIL: tests/jqtest\r\n==================\r\n\r\nSegmentation fault\r\nFAIL tests/jqtest (exit status: 139)\r\n\r\nFAIL: tests/onigtest\r\n====================\r\n\r\nSegmentation fault\r\nFAIL tests/onigtest (exit status: 139)\r\n\r\nFAIL: tests/shtest\r\n==================\r\n\r\njq: jv.c:435: jvp_string_ptr: Assertion `jv_get_kind(a) == JV_KIND_STRING' failed.\r\nAborted\r\nFAIL tests/shtest (exit status: 134)\r\n
\r\n\r\nVersion 1.4 worked [just fine](https://buildd.debian.org/status/package.php?p=jq&suite=jessie). Any ideas?" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/986", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/986/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/986/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/986/events", "html_url": "https://github.com/stedolan/jq/issues/986", "id": 111039703, "number": 986, "title": "Anchors don't account for height of top nav bar", "user": { "login": "dtolnay", "id": 1940490, "avatar_url": "https://avatars.githubusercontent.com/u/1940490?v=3", "gravatar_id": "", "url": "https://api.github.com/users/dtolnay", "html_url": "https://github.com/dtolnay", "followers_url": "https://api.github.com/users/dtolnay/followers", "following_url": "https://api.github.com/users/dtolnay/following{/other_user}", "gists_url": "https://api.github.com/users/dtolnay/gists{/gist_id}", "starred_url": "https://api.github.com/users/dtolnay/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dtolnay/subscriptions", "organizations_url": "https://api.github.com/users/dtolnay/orgs", "repos_url": "https://api.github.com/users/dtolnay/repos", "events_url": "https://api.github.com/users/dtolnay/events{/privacy}", "received_events_url": "https://api.github.com/users/dtolnay/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/site", "name": "site", "color": "5319e7" } ], "state": "open", "locked": false, "assignee": { "login": "dtolnay", "id": 1940490, "avatar_url": "https://avatars.githubusercontent.com/u/1940490?v=3", "gravatar_id": "", "url": "https://api.github.com/users/dtolnay", "html_url": "https://github.com/dtolnay", "followers_url": "https://api.github.com/users/dtolnay/followers", "following_url": "https://api.github.com/users/dtolnay/following{/other_user}", "gists_url": "https://api.github.com/users/dtolnay/gists{/gist_id}", "starred_url": "https://api.github.com/users/dtolnay/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dtolnay/subscriptions", "organizations_url": "https://api.github.com/users/dtolnay/orgs", "repos_url": "https://api.github.com/users/dtolnay/repos", "events_url": "https://api.github.com/users/dtolnay/events{/privacy}", "received_events_url": "https://api.github.com/users/dtolnay/received_events", "type": "User", "site_admin": false }, "milestone": null, "comments": 2, "created_at": "2015-10-12T19:32:14Z", "updated_at": "2015-10-14T06:34:16Z", "closed_at": null, "body": "When you visit (for example) https://stedolan.github.io/jq/manual/#Arrayconstruction-[], part of the header is hidden behind the top nav bar:\r\n\r\n![anchor](https://cloud.githubusercontent.com/assets/1940490/10436715/0464e950-70dd-11e5-8a84-36dad08ebda3.png)\r\n" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/975", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/975/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/975/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/975/events", "html_url": "https://github.com/stedolan/jq/issues/975", "id": 109667227, "number": 975, "title": "Proposal: innerjoin and friends", "user": { "login": "pkoppstein", "id": 172847, "avatar_url": "https://avatars.githubusercontent.com/u/172847?v=3", "gravatar_id": "", "url": "https://api.github.com/users/pkoppstein", "html_url": "https://github.com/pkoppstein", "followers_url": "https://api.github.com/users/pkoppstein/followers", "following_url": "https://api.github.com/users/pkoppstein/following{/other_user}", "gists_url": "https://api.github.com/users/pkoppstein/gists{/gist_id}", "starred_url": "https://api.github.com/users/pkoppstein/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pkoppstein/subscriptions", "organizations_url": "https://api.github.com/users/pkoppstein/orgs", "repos_url": "https://api.github.com/users/pkoppstein/repos", "events_url": "https://api.github.com/users/pkoppstein/events{/privacy}", "received_events_url": "https://api.github.com/users/pkoppstein/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/contribution", "name": "contribution", "color": "d4c5f9" }, { "url": "https://api.github.com/repos/stedolan/jq/labels/feature%20request:%20jq%20function%20library", "name": "feature request: jq function library", "color": "207de5" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 2, "created_at": "2015-10-04T07:01:28Z", "updated_at": "2015-10-06T22:30:55Z", "closed_at": null, "body": "This proposal envisions the addition of four new builtin function names for the following five filters:\r\n```\r\nobjectify/1 -- create an object from an array of headers (interpreted as\r\n key names) and an array of values;\r\n\r\nquery/1 -- query one object using another as a \"query object\";\r\n\r\ncoalesce/1 -- combine an array of objects into a single object by \r\n coalescing values (at a specified key) into an array, e.g.:\r\n\t \r\n\t [{id:1, \"a\":1}, {id:1, \"a\":2}] | coalesce(\"a\")\r\n\t produces: {\"id\": 1, \"a\": [1,2]}\r\n\r\ncoalesce/2 -- given an array of objects, a query object to be used for\r\n grouping, and the name of a key to be used for coalescing,\r\n\t produce an array of coalesced objects, one per group.\r\n\r\ninnerjoin(r1; r2; queryobject) -- compute the JSON analog of the \"inner join\" of\r\n of r1 and r2, where these are the JSON analogs of two tables,\r\n\t and queryobject defines the join key.\r\n```\r\nNote: \"innerjoin/3\" and its implementation are experimental; in particular, it might be better to define innerjoin(queryobject) with the input being an array [r1, r2, ...].\r\n\r\nTo illustrate the power and utility of these filters, consider the following sequence of two tasks:\r\n\r\n(1) the transformation of a \"flat\" CSV or TSV file (or similar array of arrays) into a non-flat object-oriented structure;\r\n\r\n(2) the computation of an \"inner join\".\r\n\r\nSuppose we start with a CSV file containing the following data recording responses on a multiple-choice questionnaire:\r\n\r\nTable 1\r\n```\r\nid | question_id| respondent_id| value_response\r\n-------------------------------| --------------\r\n1 | 1 | 1 | SFU \r\n2 | 1 | 1 | UBC \r\n3 | 2 | 1 | BU \r\n4 | 2 | 1 | RI\r\n5 | 1 | 2 | ABC\r\n6 | 1 | 2 | DEF\r\n7 | 2 | 2 | BU \r\n8 | 2 | 2 | XYZ\r\n```\r\n\r\nThe first task is to transform this into a a JSON representation in which the responses for each respondent-question are available as a single array. That is, we want to produce an array of objects, each having the form:\r\n\r\n{ question_id: _, respondent_id: _, value_responses: [ ... ] }\r\n\r\nThe second task is to compute the JSON representation of the inner join of this relation with the following:\r\n\r\nTable 2\r\n```\r\nquestion_id | question_name\r\n---------------------------\r\n1 | Q1\r\n2 | Q2\r\n```\r\n\r\nAssuming we have read each of the flat files into an array of arrays in the obvious way, the first task can be accomplished as follows, using the proposed filters:\r\n\r\nFor the first table:\r\n```\r\n .[0] as $headers\r\n | .[1:] | map(objectify($headers));\r\n | map(del(.id))\r\n | coalesce( { \"question_id\": 0, \"respondent_id\": 0}; \"value_response\" )\r\n```\r\nIf this representation of the first table is defined as Table1 and if Table2 is the objectified representation of Table 2, then the innerjoin can be computed by:\r\n```\r\n innerjoin(Table1; Table2; {question_id: 0}).\r\n```\r\n### Implementation\r\n\r\nConverting a CSV file to a JSON array of arrays can most robustly be accomplished\r\nusing a tool such as any-json, so we won't dwell on that further.\r\n\r\nHere then are the proposed definitions of the new filters, with comments:\r\n```\r\ndef objectify(headers):\r\n . as $in\r\n | reduce range(0; headers|length) as $i ({}; .[headers[$i]] = $in[$i] );\r\n\r\ndef query(object):\r\n with_entries( select( .key as $key | object | has( $key ) ));\r\n\r\n# Given an array of objects with a key specified by \"key\", sum the\r\n# objects using + for all keys except \"key\", and coalescing the values at \"key\":\r\ndef coalesce( key ):\r\n reduce .[] as $o ({}; .[key] += [$o[key]] | . + ($o|delpaths([[key]]) ) );\r\n\r\n# Input: an array of objects\r\n# group: an object defining a grouping criterion\r\n# ckey: the key to coalesce (a string)\r\n# Output: an array of objects, one per group\r\ndef coalesce(group; ckey):\r\n group_by( query(group) )\r\n | map(coalesce(ckey)) ;\r\n\r\n\r\n# Assuming r1 and r2 are objectified representations of relational\r\n# tables, innerjoin(r1;r2;q) computes the objectifed representation of\r\n# their innerjoin, using q as the query object defining the join-key.\r\n@ (An example is given below.)\r\ndef innerjoin(r1; r2; queryobject):\r\n reduce r1[] as $row1 ([];\r\n (r2 | map(select( query(queryobject) == ($row1|query(queryobject)) ))) as $row2\r\n | . + ($row2 | map( $row1 + . )) );\r\n```\r\n\r\n#### Example of innerjoin/3\r\n\r\nGiven:\r\n```\r\ndef r1:\r\n [ {qid:1, qname: \"Q1\"}, {qid:2, qname: \"Q2\"}];\r\n\r\ndef r2:\r\n [ {student_id: \"A\", qid: 1},\r\n {student_id: \"A\", qid: 2},\r\n {student_id: \"B\", qid: 1},\r\n {student_id: \"B\", qid: 2}];\r\n``` \r\nthen `innerjoin( r1; r2; {qid:null})` produces:\r\n```\r\n[ {\"qid\":1,\"qname\":\"Q1\",\"student_id\":\"A\"},\r\n {\"qid\":1,\"qname\":\"Q1\",\"student_id\":\"B\"},\r\n {\"qid\":2,\"qname\":\"Q2\",\"student_id\":\"A\"},\r\n {\"qid\":2,\"qname\":\"Q2\",\"student_id\":\"B\"} ]\r\n```\r\n" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/974", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/974/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/974/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/974/events", "html_url": "https://github.com/stedolan/jq/issues/974", "id": 109662501, "number": 974, "title": "Enhancement request: specify flags in script file", "user": { "login": "markjreed", "id": 361055, "avatar_url": "https://avatars.githubusercontent.com/u/361055?v=3", "gravatar_id": "", "url": "https://api.github.com/users/markjreed", "html_url": "https://github.com/markjreed", "followers_url": "https://api.github.com/users/markjreed/followers", "following_url": "https://api.github.com/users/markjreed/following{/other_user}", "gists_url": "https://api.github.com/users/markjreed/gists{/gist_id}", "starred_url": "https://api.github.com/users/markjreed/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/markjreed/subscriptions", "organizations_url": "https://api.github.com/users/markjreed/orgs", "repos_url": "https://api.github.com/users/markjreed/repos", "events_url": "https://api.github.com/users/markjreed/events{/privacy}", "received_events_url": "https://api.github.com/users/markjreed/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/feature%20request", "name": "feature request", "color": "207de5" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 9, "created_at": "2015-10-04T04:25:02Z", "updated_at": "2015-10-06T22:04:44Z", "closed_at": null, "body": "It would be useful if a script file (to be read via `jq -f`) had a way of specifying that it should be run with other command-line options. For example, it might be written to assume slurp mode, so it would be nice if it could indicate that somehow - perhaps similar to the way Perl will look for and honor flags in the shebang line even if not executed via exec(). \r\n\r\nOf course you could just make it a shell script, but then the jq file is not itself portable between windows and unix." }, { "url": "https://api.github.com/repos/stedolan/jq/issues/970", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/970/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/970/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/970/events", "html_url": "https://github.com/stedolan/jq/issues/970", "id": 109314154, "number": 970, "title": "map_values and select work together?", "user": { "login": "rikrd", "id": 15324, "avatar_url": "https://avatars.githubusercontent.com/u/15324?v=3", "gravatar_id": "", "url": "https://api.github.com/users/rikrd", "html_url": "https://github.com/rikrd", "followers_url": "https://api.github.com/users/rikrd/followers", "following_url": "https://api.github.com/users/rikrd/following{/other_user}", "gists_url": "https://api.github.com/users/rikrd/gists{/gist_id}", "starred_url": "https://api.github.com/users/rikrd/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rikrd/subscriptions", "organizations_url": "https://api.github.com/users/rikrd/orgs", "repos_url": "https://api.github.com/users/rikrd/repos", "events_url": "https://api.github.com/users/rikrd/events{/privacy}", "received_events_url": "https://api.github.com/users/rikrd/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/feature%20request", "name": "feature request", "color": "207de5" }, { "url": "https://api.github.com/repos/stedolan/jq/labels/support", "name": "support", "color": "bfe5bf" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 33, "created_at": "2015-10-01T14:41:30Z", "updated_at": "2015-10-04T06:22:51Z", "closed_at": null, "body": "Hi, shouldn't this work?\r\n\r\nhttps://jqplay.org/jq?q=.toto%20|%20map_values(select(.x==%22t%22))&j={%22toto%22:%20{%22a%22:%20{%22x%22:%20%22t%22},%20%22b%22:%20{%22x%22:%20%22t%22},%20%22c%22:%20{%22x%22:%20%22r%22}}}\r\n\r\nThe output I was expecting was:\r\n```json\r\n\"a\": {\"x\": \"t\"}, \"b\": {\"x\": \"t\"}\r\n```" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/967", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/967/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/967/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/967/events", "html_url": "https://github.com/stedolan/jq/issues/967", "id": 108746628, "number": 967, "title": "Document delpaths", "user": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/docs", "name": "docs", "color": "5319e7" } ], "state": "open", "locked": false, "assignee": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "milestone": null, "comments": 0, "created_at": "2015-09-28T21:05:29Z", "updated_at": "2015-09-28T21:05:29Z", "closed_at": null, "body": "" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/965", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/965/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/965/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/965/events", "html_url": "https://github.com/stedolan/jq/issues/965", "id": 108717290, "number": 965, "title": "Allow setting raw input delimiter", "user": { "login": "phiresky", "id": 2303841, "avatar_url": "https://avatars.githubusercontent.com/u/2303841?v=3", "gravatar_id": "", "url": "https://api.github.com/users/phiresky", "html_url": "https://github.com/phiresky", "followers_url": "https://api.github.com/users/phiresky/followers", "following_url": "https://api.github.com/users/phiresky/following{/other_user}", "gists_url": "https://api.github.com/users/phiresky/gists{/gist_id}", "starred_url": "https://api.github.com/users/phiresky/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/phiresky/subscriptions", "organizations_url": "https://api.github.com/users/phiresky/orgs", "repos_url": "https://api.github.com/users/phiresky/repos", "events_url": "https://api.github.com/users/phiresky/events{/privacy}", "received_events_url": "https://api.github.com/users/phiresky/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/feature%20request", "name": "feature request", "color": "207de5" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 5, "created_at": "2015-09-28T18:18:31Z", "updated_at": "2015-09-28T19:56:55Z", "closed_at": null, "body": "As far as I can tell, this is not currently possible?\r\n\r\nmain use case:\r\n`find | jq -R` works\r\n\r\nbut because filenames can contain newlines that is not safe, so I'd like to use `find -print0`, but jq does not allow setting \\0 as the input delimiter (or setting it at all).\r\n\r\nIt can be circumvented with\r\n```bash\r\nfind -print0|jq --slurp --raw-input 'split(\"\\u0000\")[]'\r\n```\r\n\r\nbut that disables streaming the input\r\n\r\n\r\nUsage in other programs (for \\0):\r\n\r\n* `xargs -0` or `xargs --null`\r\n* `sed -z` or `sed --null-data`" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/957", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/957/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/957/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/957/events", "html_url": "https://github.com/stedolan/jq/issues/957", "id": 107581836, "number": 957, "title": "Array-capable merge", "user": { "login": "rektide", "id": 53243, "avatar_url": "https://avatars.githubusercontent.com/u/53243?v=3", "gravatar_id": "", "url": "https://api.github.com/users/rektide", "html_url": "https://github.com/rektide", "followers_url": "https://api.github.com/users/rektide/followers", "following_url": "https://api.github.com/users/rektide/following{/other_user}", "gists_url": "https://api.github.com/users/rektide/gists{/gist_id}", "starred_url": "https://api.github.com/users/rektide/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rektide/subscriptions", "organizations_url": "https://api.github.com/users/rektide/orgs", "repos_url": "https://api.github.com/users/rektide/repos", "events_url": "https://api.github.com/users/rektide/events{/privacy}", "received_events_url": "https://api.github.com/users/rektide/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/feature%20request:%20jq%20function%20library", "name": "feature request: jq function library", "color": "207de5" }, { "url": "https://api.github.com/repos/stedolan/jq/labels/support", "name": "support", "color": "bfe5bf" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 4, "created_at": "2015-09-21T19:28:02Z", "updated_at": "2015-09-29T04:46:42Z", "closed_at": null, "body": "Current merge behavior when encountering two arrays in the same slot is to blow away the current array with the previous array.\r\n\r\n```\r\njq -s '.[0] += .[1] | .[0]' <(echo '{\"a\": 1, \"array\": [1,2,3]}') <(echo '{\"b\": 10, \"array\": [11,12,13]}')\r\n{\r\n \"a\": 1,\r\n \"array\": [\r\n 11,12,13\r\n ],\r\n \"b\": 10\r\n}\r\n```\r\n\r\nTo work around, I frequently use some temporary space to store the specific, about to be stomped array, and then I re-concat it in again latter. For example below, .[2] is that temporary store-\r\n\r\n```\r\njq -s '.[2] = .[0].array | .[0] += .[1] | .[0].array = .[2] + .[0].array | .[0]' <(echo '{\"a\": 1, \"array\": [1,2,3]}') <(echo '{\"b\": 10, \"array\": [11,12,13]}')\r\n{\r\n \"a\": 1,\r\n \"array\": [\r\n 1,2,3,11,12,13\r\n ],\r\n \"b\": 10\r\n} \r\n```\r\n\r\nThis practice keeps cropping up in more and more jq code that I touch.\r\n\r\nI would *love* an array capable merge, that can automatically concat two arrays in the same structural spot together. The current concat should almost certainly be preserved as is (to avoid breakage, whatnot)- I'm not sure what to propose for implementation, but I'd tend towards introducing a new, similar operator. I dont think _ has any interesting uses atm? :/" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/929", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/929/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/929/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/929/events", "html_url": "https://github.com/stedolan/jq/issues/929", "id": 103270993, "number": 929, "title": "OS X \"strptime\" results inconsistent with Linux", "user": { "login": "vielmetti", "id": 35047, "avatar_url": "https://avatars.githubusercontent.com/u/35047?v=3", "gravatar_id": "", "url": "https://api.github.com/users/vielmetti", "html_url": "https://github.com/vielmetti", "followers_url": "https://api.github.com/users/vielmetti/followers", "following_url": "https://api.github.com/users/vielmetti/following{/other_user}", "gists_url": "https://api.github.com/users/vielmetti/gists{/gist_id}", "starred_url": "https://api.github.com/users/vielmetti/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vielmetti/subscriptions", "organizations_url": "https://api.github.com/users/vielmetti/orgs", "repos_url": "https://api.github.com/users/vielmetti/repos", "events_url": "https://api.github.com/users/vielmetti/events{/privacy}", "received_events_url": "https://api.github.com/users/vielmetti/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/bug", "name": "bug", "color": "e11d21" }, { "url": "https://api.github.com/repos/stedolan/jq/labels/portability", "name": "portability", "color": "006b75" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 2, "created_at": "2015-08-26T13:32:14Z", "updated_at": "2015-08-31T18:22:09Z", "closed_at": null, "body": "The task I'm trying to accomplish is to pull in data from a data source that has timestamps but that doesn't specify time zone or daylight savings time. Ideally I'll get an accurate \"seconds since the epoch\" when I'm done parsing.\r\n\r\nThe problem is that I get different results depending on whether I'm on OS X Mavericks or on Linux Ubuntu. Here's a small sample script; I'm in EDT:\r\n\r\n```shell\r\ndate | sed -e 's/^/\\\"/' -e 's/$/\\\"/' | ./jq '(strptime(\"%a %b %d %H:%M:%S %Z %Y\")|mktime) - now'\r\n```\r\n\r\n(feed the output of the date command into jq as a string, parse the time, subtract current time, result in seconds).\r\n\r\nOn OS X I typically get output like -14400.879971027374 which corresponds to 4 hours off.\r\n\r\nOn Ubuntu I get output like -0.6590850353240967 which is less than a second off.\r\n\r\nIf I had to guess, there's something to do with this in the OS X docs:\r\n\r\n```\r\n The %Z format specifier only accepts time zone abbreviations of the local\r\n time zone, or the value \"GMT\". This limitation is because of ambiguity\r\n due to of the over loading of time zone abbreviations. One such example\r\n is EST which is both Eastern Standard Time and Eastern Australia Summer\r\n Time.\r\n\r\n```\r\n\r\nbut not in the Ubuntu docs, which reference glibc:\r\n\r\n```\r\n %Z The timezone name.\r\n```" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/925", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/925/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/925/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/925/events", "html_url": "https://github.com/stedolan/jq/issues/925", "id": 102700027, "number": 925, "title": "I/O primitives, take N", "user": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/feature%20request", "name": "feature request", "color": "207de5" } ], "state": "open", "locked": false, "assignee": null, "milestone": { "url": "https://api.github.com/repos/stedolan/jq/milestones/8", "html_url": "https://github.com/stedolan/jq/milestones/Maybe%20someday%20(wishlist)", "labels_url": "https://api.github.com/repos/stedolan/jq/milestones/8/labels", "id": 975948, "number": 8, "title": "Maybe someday (wishlist)", "description": "", "creator": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "open_issues": 3, "closed_issues": 0, "state": "open", "created_at": "2015-02-11T21:32:17Z", "updated_at": "2015-09-11T16:56:01Z", "due_on": null, "closed_at": null }, "comments": 0, "created_at": "2015-08-24T04:01:47Z", "updated_at": "2015-10-28T02:47:08Z", "closed_at": null, "body": "New plan for better I/O.\r\n\r\nFirst, finish the C-coded generators branch. C-coded generators are like C-coded functions, but take a `void **state` argument in which to keep state, return an invalid jv to denote backtracking, and get called with invalid inputs to denote resumption (i.e., the expression that gets the generator's output backtracked). During backtracking due to errors or cleanup any suspended C-coded generators get to cleanup state, and even catch errors -- this is important as we'll see below.\r\n\r\nSecond, manage privilege as follows:\r\n\r\n - low-level I/O C-coded builtins are only provided to bind unbound references in mid-/high-level I/O builtins and not to any others nor user-coded jq programs;\r\n - two sets of mid-/high-level I/O builtins: one that does real I/O, and one set of stubs that raise errors;\r\n - by default user-coded jq programs and modules get the stub I/O builtins;\r\n - a single new CLI option for indicating which module(s) (or even the top-level program) get the real I/O builtins;\r\n - modules allowed privileges can also grant them to others via the `import`/`include` directives (e.g., `import \"foo\" {privileged: true};`).\r\n\r\nThis means that users can create modules that perform access controls for sandboxing jq programs' I/O. They can express all authorization as jq code, or they can jq-code a module that allows expressing authorization via JSON files, allowing incantations like this: `jq --arg ACL acl.json --privilege wrappers/json_acl 'include \"wrappers/json_acl\"; readfile'` -> read files named on `stdin` wherever the given ACL file permits it.\r\n\r\nBecause we'd be encouraging the creation of wrapper modules, we might want to have an option for implicitly injecting `include`s of wrapper modules into top-level programs, so the previous example becomes `jq --arg ACL acl.json --privilege wrappers/json_acl --include wrappers/json_acl readfile` or maybe `jq --arg ACL acl.json --include-privileged wappers/json_acl readfile`.\r\n\r\nThird, create low-level C-coded generators for opening files/commands, and which output \"file handles\" (which will be plain jv values, of course), and C-coded read/write functions. These will never be available to users; only mid-/high-level builtin functions will have these, and the mid-/high-level builtins will never leak file handles or allow user programs to provide file handles that could get passed to the low-level I/O builtins. This, and the state management that C-coded generators get to do, means that we can *safely* actually encode things like `FILE *` values as jv values.\r\n\r\nThis plan works for file I/O and popen.\r\n\r\nFor other things, like co-routines, we may need a better notion of file descriptor-like handles, but that can be left out of scope for now even, though co-routines are appealing. (Icon, like jq has no closures of indefinite extent. Icon uses co-expressions to get around that limitation, with co-expressions holding on to copies of lexically visible bindings at co-expression instantiation time. Something similar for jq would be very nice indeed. Co-routines are a very nice balance of trade-offs compared to `call/cc` and a reasonable trade-off for lacking indefinite-extent closures (and as the latter can be used together with CPS conversion to construct `call/cc`, I repeat myself). jq needs a co-eval as well, so as to make it possible to jq-code a REPL that doesn't have to spawn jq.)\r\n\r\nBottom-line: jq programs would remain by-default sandboxed to filtering inputs to outputs, and jq would remain a DSL, but I/O with a decent privilege management model would begin to make jq a more general-purpose language.\r\n\r\nIt is worth noting that jq is a functional language, and that while adding builtins with non-deterministic behavior by and large does not change that, it does mean that the compiler has to know that such builtins are non-deterministic if we ever get to generalize constant-folding, or attempt better common sub-expression elimination, or other optimizations. We've already crossed the non-determinism Rubicon with the `input` and `inputs` builtins, and in practice jq programs are small enough that constant-folding and CSE is something that the user can be expected to do themselves if it really matters, so we might never care that much (users can constant-fold arithmetic, but not array/object construction, so it pays to have that).\r\n\r\nEDIT: Fix typo." }, { "url": "https://api.github.com/repos/stedolan/jq/issues/913", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/913/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/913/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/913/events", "html_url": "https://github.com/stedolan/jq/issues/913", "id": 101238187, "number": 913, "title": "Build Solaris executables for 1.5", "user": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/release/packaging", "name": "release/packaging", "color": "fbca04" } ], "state": "open", "locked": false, "assignee": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "milestone": { "url": "https://api.github.com/repos/stedolan/jq/milestones/3", "html_url": "https://github.com/stedolan/jq/milestones/1.5%20release", "labels_url": "https://api.github.com/repos/stedolan/jq/milestones/3/labels", "id": 682789, "number": 3, "title": "1.5 release", "description": "jq 1.5 should get all the features that won't be going into 1.4:\r\n\r\n - loadable modules\r\n - better jq library support\r\n - regexp/glob support\r\n - I/O primitives\r\n - generator primitives: `while`,\r\n - generator utils: `foreach`, `limit`\r\n - `try EXP catch EXP` (exceptions)\r\n - bignum support\r\n - anything else?", "creator": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "open_issues": 1, "closed_issues": 128, "state": "closed", "created_at": "2014-06-05T23:19:44Z", "updated_at": "2015-09-11T16:43:59Z", "due_on": null, "closed_at": "2015-08-16T06:59:34Z" }, "comments": 2, "created_at": "2015-08-16T06:46:34Z", "updated_at": "2015-08-16T07:33:31Z", "closed_at": null, "body": "" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/911", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/911/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/911/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/911/events", "html_url": "https://github.com/stedolan/jq/issues/911", "id": 101234580, "number": 911, "title": "Win32 build is broken, needs to find PathIsRelativeA()", "user": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/build", "name": "build", "color": "eb6420" } ], "state": "open", "locked": false, "assignee": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "milestone": { "url": "https://api.github.com/repos/stedolan/jq/milestones/7", "html_url": "https://github.com/stedolan/jq/milestones/1.6%20release", "labels_url": "https://api.github.com/repos/stedolan/jq/milestones/7/labels", "id": 882049, "number": 7, "title": "1.6 release", "description": "", "creator": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "open_issues": 29, "closed_issues": 8, "state": "open", "created_at": "2014-11-26T23:57:47Z", "updated_at": "2015-10-28T02:11:40Z", "due_on": null, "closed_at": null }, "comments": 3, "created_at": "2015-08-16T05:02:07Z", "updated_at": "2015-09-06T19:46:16Z", "closed_at": null, "body": "`linker.c` needs to include `` and ``, and jq needs to link with `-lshlwapi` when building with mingw. I'm not sure if the latter is something we should do unconditionally in `configure.ac`, so I'll not fix that (instead we can point out the need to add it to `LDFLAGS` in the ./configure incantation)." }, { "url": "https://api.github.com/repos/stedolan/jq/issues/909", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/909/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/909/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/909/events", "html_url": "https://github.com/stedolan/jq/issues/909", "id": 101116924, "number": 909, "title": "Change website link to https", "user": { "login": "dtolnay", "id": 1940490, "avatar_url": "https://avatars.githubusercontent.com/u/1940490?v=3", "gravatar_id": "", "url": "https://api.github.com/users/dtolnay", "html_url": "https://github.com/dtolnay", "followers_url": "https://api.github.com/users/dtolnay/followers", "following_url": "https://api.github.com/users/dtolnay/following{/other_user}", "gists_url": "https://api.github.com/users/dtolnay/gists{/gist_id}", "starred_url": "https://api.github.com/users/dtolnay/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dtolnay/subscriptions", "organizations_url": "https://api.github.com/users/dtolnay/orgs", "repos_url": "https://api.github.com/users/dtolnay/repos", "events_url": "https://api.github.com/users/dtolnay/events{/privacy}", "received_events_url": "https://api.github.com/users/dtolnay/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/task", "name": "task", "color": "fbca04" } ], "state": "open", "locked": false, "assignee": { "login": "stedolan", "id": 79765, "avatar_url": "https://avatars.githubusercontent.com/u/79765?v=3", "gravatar_id": "", "url": "https://api.github.com/users/stedolan", "html_url": "https://github.com/stedolan", "followers_url": "https://api.github.com/users/stedolan/followers", "following_url": "https://api.github.com/users/stedolan/following{/other_user}", "gists_url": "https://api.github.com/users/stedolan/gists{/gist_id}", "starred_url": "https://api.github.com/users/stedolan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stedolan/subscriptions", "organizations_url": "https://api.github.com/users/stedolan/orgs", "repos_url": "https://api.github.com/users/stedolan/repos", "events_url": "https://api.github.com/users/stedolan/events{/privacy}", "received_events_url": "https://api.github.com/users/stedolan/received_events", "type": "User", "site_admin": false }, "milestone": null, "comments": 0, "created_at": "2015-08-14T22:40:32Z", "updated_at": "2015-08-14T22:40:32Z", "closed_at": null, "body": "At the top of this page https://github.com/stedolan/jq\r\n\r\n\r\n[![jq-website](https://cloud.githubusercontent.com/assets/1940490/9285435/b781790c-429a-11e5-91d6-4044269e4220.png)](https://github.com/stedolan/jq)" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/907", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/907/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/907/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/907/events", "html_url": "https://github.com/stedolan/jq/issues/907", "id": 100933191, "number": 907, "title": "Binary data as arrays of numeric byte values", "user": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/feature%20request", "name": "feature request", "color": "207de5" } ], "state": "open", "locked": false, "assignee": null, "milestone": { "url": "https://api.github.com/repos/stedolan/jq/milestones/8", "html_url": "https://github.com/stedolan/jq/milestones/Maybe%20someday%20(wishlist)", "labels_url": "https://api.github.com/repos/stedolan/jq/milestones/8/labels", "id": 975948, "number": 8, "title": "Maybe someday (wishlist)", "description": "", "creator": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "open_issues": 3, "closed_issues": 0, "state": "open", "created_at": "2015-02-11T21:32:17Z", "updated_at": "2015-09-11T16:56:01Z", "due_on": null, "closed_at": null }, "comments": 0, "created_at": "2015-08-14T04:51:37Z", "updated_at": "2015-08-14T04:51:45Z", "closed_at": null, "body": "jq could have a binary input mode (probably something we want to leave to I/O plugins, rather than add as a new command-line option), in which inputs are arrays of numeric byte values.\r\n\r\nBase64 encoding should accept binary and string data.\r\n\r\nBase64 decoding should produce binary data when the decoded data includes invalid Unicode codepoints.\r\n\r\n`startswith`, `endswith`, `index`, `indices`, and others should work equally with strings as with binary data. But `|startswith([65])` should probably raise a type error.\r\n\r\nThere could be a `binary` builtin which passes binary and string values through but which raises an error (or does `empty`?) if the input is anything else. This could be a way to convert plain arrays of numbers to whatever optimized internal representation we might have for binary data (IF we have one anyways).\r\n\r\nInternally we could have a variant of array `jv` that points to a C byte array. Obviously this would only be a good deal for jq programs that deal with binary a lot, but perhaps we can make it not cost a lot for all others." }, { "url": "https://api.github.com/repos/stedolan/jq/issues/905", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/905/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/905/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/905/events", "html_url": "https://github.com/stedolan/jq/issues/905", "id": 100930983, "number": 905, "title": "Dev process", "user": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/wiki", "name": "wiki", "color": "d4c5f9" } ], "state": "open", "locked": false, "assignee": null, "milestone": null, "comments": 0, "created_at": "2015-08-14T04:27:43Z", "updated_at": "2015-08-14T04:28:13Z", "closed_at": null, "body": "We should probably document a dev process. It's pretty light-weight, really: file issues, file PRs, get code reviews, push. For new features we need feedback on the associated issues. Don't break backwards-compatibility. Document and test. Never force a non-fast-forward merge. For now we do not do micro releases, only minor ones, but we'll do a minor release if needed. That sort of thing.\r\n\r\nBut there's some small things we should consider:\r\n\r\n - perhaps regression tests should be committed separately and before the fixes: so that we can observe tests failing (without the fix) then passing (with the fix)\r\n\r\n - perhaps we should document the C style in a wiki page (`done`).\r\n\r\n - we need a way to sign releases and bind release downloadables into the master branch." }, { "url": "https://api.github.com/repos/stedolan/jq/issues/897", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/897/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/897/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/897/events", "html_url": "https://github.com/stedolan/jq/issues/897", "id": 100426763, "number": 897, "title": "Assignment operator usability issues", "user": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/usability", "name": "usability", "color": "d4c5f9" } ], "state": "open", "locked": false, "assignee": null, "milestone": { "url": "https://api.github.com/repos/stedolan/jq/milestones/8", "html_url": "https://github.com/stedolan/jq/milestones/Maybe%20someday%20(wishlist)", "labels_url": "https://api.github.com/repos/stedolan/jq/milestones/8/labels", "id": 975948, "number": 8, "title": "Maybe someday (wishlist)", "description": "", "creator": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "open_issues": 3, "closed_issues": 0, "state": "open", "created_at": "2015-02-11T21:32:17Z", "updated_at": "2015-09-11T16:56:01Z", "due_on": null, "closed_at": null }, "comments": 5, "created_at": "2015-08-11T22:38:05Z", "updated_at": "2015-08-22T17:17:30Z", "closed_at": null, "body": "The assignment operators are somewhat tricky to use. This may be mostly a matter of documentation...\r\n\r\nIssues:\r\n\r\n - users often miss the fact that the LHS expression is supposed to be a path expression matching paths in `.`\r\n - `=` and `|=` have different semantics besides `|=` passing the value at the LHS paths to the RHS expression. Compare `jq -n '(.a, .b, .c) = (1,2,3)'` to `jq -n '(.a, .b, .c) |= (1,2,3)'`.\r\n\r\nThe first issue is easy enough to handle in documentation.\r\n\r\nThe second issue is difficult to \"fix\" without risking breaking jq programs. Since `|=` is supposed to modify whatever value is found at the LHS, only one of the RHS expressions' outputs can be used as the final value -- there is just no question of making `|=` work like `=`. One reason that we can't make `|=` work like `=` is that while the RHS in the `=` case will produce the same outputs for all paths named in the LHS, the RHS in the `|=` absolutely can produce different sets of outputs for each path as the RHS gets a possibly-different input for each path in `.`. At best we could make `=` work like `|=`, but `=`'s behavior as to RHS generator expressions seems to be just too useful, and thus likely to be depended upon. This too, then, seems like a job for documentation.\r\n\r\nUnless other issues crop up, we should close this one (perhaps after tweaking the docs)." }, { "url": "https://api.github.com/repos/stedolan/jq/issues/882", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/882/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/882/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/882/events", "html_url": "https://github.com/stedolan/jq/issues/882", "id": 99051389, "number": 882, "title": "Index array by array/object", "user": { "login": "slapresta", "id": 3437734, "avatar_url": "https://avatars.githubusercontent.com/u/3437734?v=3", "gravatar_id": "", "url": "https://api.github.com/users/slapresta", "html_url": "https://github.com/slapresta", "followers_url": "https://api.github.com/users/slapresta/followers", "following_url": "https://api.github.com/users/slapresta/following{/other_user}", "gists_url": "https://api.github.com/users/slapresta/gists{/gist_id}", "starred_url": "https://api.github.com/users/slapresta/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/slapresta/subscriptions", "organizations_url": "https://api.github.com/users/slapresta/orgs", "repos_url": "https://api.github.com/users/slapresta/repos", "events_url": "https://api.github.com/users/slapresta/events{/privacy}", "received_events_url": "https://api.github.com/users/slapresta/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/docs", "name": "docs", "color": "5319e7" }, { "url": "https://api.github.com/repos/stedolan/jq/labels/usability", "name": "usability", "color": "d4c5f9" } ], "state": "open", "locked": false, "assignee": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "milestone": { "url": "https://api.github.com/repos/stedolan/jq/milestones/7", "html_url": "https://github.com/stedolan/jq/milestones/1.6%20release", "labels_url": "https://api.github.com/repos/stedolan/jq/milestones/7/labels", "id": 882049, "number": 7, "title": "1.6 release", "description": "", "creator": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "open_issues": 29, "closed_issues": 8, "state": "open", "created_at": "2014-11-26T23:57:47Z", "updated_at": "2015-10-28T02:11:40Z", "due_on": null, "closed_at": null }, "comments": 26, "created_at": "2015-08-04T20:10:49Z", "updated_at": "2015-08-16T06:00:59Z", "closed_at": null, "body": "Is indexing an array by another array supposed to mean anything at all? I would expect something similar to `jq: error: Cannot index array with array [1, 2]`, but instead I get this:\r\n\r\n```\r\njq -n '[1, 2, 3] | .[[1, 2]]'\r\n[\r\n 0\r\n]\r\n```\r\n\r\n```\r\njq -n '[1, 2, 3] | .[[]]'\r\n[]\r\n```\r\n\r\nAlso, apparently you can do array slices by indexing with objects? I guess [1:3] actually desugars to this, but we should document it; this could actually be useful.\r\n\r\n```\r\nᐷ jq -n '[1, 2, 3, 4] | .[{\"start\": 1, \"end\": 3}]'\r\n[\r\n 2,\r\n 3\r\n]\r\n```" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/873", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/873/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/873/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/873/events", "html_url": "https://github.com/stedolan/jq/issues/873", "id": 97574956, "number": 873, "title": "Unexpected \"empty\" behaviour", "user": { "login": "borisovg", "id": 3171327, "avatar_url": "https://avatars.githubusercontent.com/u/3171327?v=3", "gravatar_id": "", "url": "https://api.github.com/users/borisovg", "html_url": "https://github.com/borisovg", "followers_url": "https://api.github.com/users/borisovg/followers", "following_url": "https://api.github.com/users/borisovg/following{/other_user}", "gists_url": "https://api.github.com/users/borisovg/gists{/gist_id}", "starred_url": "https://api.github.com/users/borisovg/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/borisovg/subscriptions", "organizations_url": "https://api.github.com/users/borisovg/orgs", "repos_url": "https://api.github.com/users/borisovg/repos", "events_url": "https://api.github.com/users/borisovg/events{/privacy}", "received_events_url": "https://api.github.com/users/borisovg/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/feature%20request", "name": "feature request", "color": "207de5" }, { "url": "https://api.github.com/repos/stedolan/jq/labels/support", "name": "support", "color": "bfe5bf" } ], "state": "open", "locked": false, "assignee": null, "milestone": { "url": "https://api.github.com/repos/stedolan/jq/milestones/7", "html_url": "https://github.com/stedolan/jq/milestones/1.6%20release", "labels_url": "https://api.github.com/repos/stedolan/jq/milestones/7/labels", "id": 882049, "number": 7, "title": "1.6 release", "description": "", "creator": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "open_issues": 29, "closed_issues": 8, "state": "open", "created_at": "2014-11-26T23:57:47Z", "updated_at": "2015-10-28T02:11:40Z", "due_on": null, "closed_at": null }, "comments": 39, "created_at": "2015-07-27T22:56:30Z", "updated_at": "2015-07-29T21:50:06Z", "closed_at": null, "body": "This could well be me misunderstanding the way `empty` works but this is unexpected:\r\n\r\n````\r\nborisov@deli:~ $ echo '{\"key1\": {\"attr1\": \"foo\"}, \"key2\": {\"attr1\": \"foo\", \"attr2\": \"bar\"}}' | jq '.[].attr2 |= if . then \"bar\" else empty end' \r\nnull\r\n````\r\n\r\nExpected something like this (but without .key1.attr2 set to \"null\"):\r\n\r\n````\r\nborisov@deli:~ $ echo '{\"key1\": {\"attr1\": \"foo\"}, \"key2\": {\"attr1\": \"foo\", \"attr2\": \"bar\"}}' | jq '.[].attr2 |= if . then \"bar\" else . end'\r\n{\r\n \"key1\": {\r\n \"attr1\": \"foo\",\r\n \"attr2\": null\r\n },\r\n \"key2\": {\r\n \"attr1\": \"foo\",\r\n \"attr2\": \"bar\"\r\n }\r\n}\r\n````\r\njq version: jq-1.5rc2" }, { "url": "https://api.github.com/repos/stedolan/jq/issues/867", "labels_url": "https://api.github.com/repos/stedolan/jq/issues/867/labels{/name}", "comments_url": "https://api.github.com/repos/stedolan/jq/issues/867/comments", "events_url": "https://api.github.com/repos/stedolan/jq/issues/867/events", "html_url": "https://github.com/stedolan/jq/issues/867", "id": 97189227, "number": 867, "title": "Set O_CLOEXEC in MT-safe way", "user": { "login": "dtolnay", "id": 1940490, "avatar_url": "https://avatars.githubusercontent.com/u/1940490?v=3", "gravatar_id": "", "url": "https://api.github.com/users/dtolnay", "html_url": "https://github.com/dtolnay", "followers_url": "https://api.github.com/users/dtolnay/followers", "following_url": "https://api.github.com/users/dtolnay/following{/other_user}", "gists_url": "https://api.github.com/users/dtolnay/gists{/gist_id}", "starred_url": "https://api.github.com/users/dtolnay/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dtolnay/subscriptions", "organizations_url": "https://api.github.com/users/dtolnay/orgs", "repos_url": "https://api.github.com/users/dtolnay/repos", "events_url": "https://api.github.com/users/dtolnay/events{/privacy}", "received_events_url": "https://api.github.com/users/dtolnay/received_events", "type": "User", "site_admin": false }, "labels": [ { "url": "https://api.github.com/repos/stedolan/jq/labels/feature%20request", "name": "feature request", "color": "207de5" } ], "state": "open", "locked": false, "assignee": null, "milestone": { "url": "https://api.github.com/repos/stedolan/jq/milestones/4", "html_url": "https://github.com/stedolan/jq/milestones/2.0%20release", "labels_url": "https://api.github.com/repos/stedolan/jq/milestones/4/labels", "id": 691688, "number": 4, "title": "2.0 release", "description": "Very, very vague at this time. For now this will have all the things we're just not ready to work on.", "creator": { "login": "nicowilliams", "id": 604851, "avatar_url": "https://avatars.githubusercontent.com/u/604851?v=3", "gravatar_id": "", "url": "https://api.github.com/users/nicowilliams", "html_url": "https://github.com/nicowilliams", "followers_url": "https://api.github.com/users/nicowilliams/followers", "following_url": "https://api.github.com/users/nicowilliams/following{/other_user}", "gists_url": "https://api.github.com/users/nicowilliams/gists{/gist_id}", "starred_url": "https://api.github.com/users/nicowilliams/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nicowilliams/subscriptions", "organizations_url": "https://api.github.com/users/nicowilliams/orgs", "repos_url": "https://api.github.com/users/nicowilliams/repos", "events_url": "https://api.github.com/users/nicowilliams/events{/privacy}", "received_events_url": "https://api.github.com/users/nicowilliams/received_events", "type": "User", "site_admin": false }, "open_issues": 14, "closed_issues": 0, "state": "open", "created_at": "2014-06-15T21:13:11Z", "updated_at": "2015-09-11T16:45:12Z", "due_on": "2016-06-19T07:00:00Z", "closed_at": null }, "comments": 1, "created_at": "2015-07-25T04:32:12Z", "updated_at": "2015-07-26T23:12:45Z", "closed_at": null, "body": "There is a glibc-specific implementation at #152." } ] ```

vito-c commented 6 years ago

I'm not sure why this is failing on nix though

--- FAIL: TestRegister (0.03s)
    register_test.go:68: Hello returned "Hello, John Doe", want "\nHello, John Doe"
FAIL
FAIL    github.com/neovim/go-client/nvim/plugin 0.053s
garyburd commented 6 years ago

Thank you for debugging this issue.