2012-09-19 00:40:35 +01:00
<!DOCTYPE html>
< html lang = "en" >
< head >
2015-08-15 13:22:58 -07:00
< script >
if ((window.location.host == "stedolan.github.io") & & (window.location.protocol != "https:"))
window.location.protocol = "https";
< / script >
2015-08-14 00:04:32 -07:00
< meta charset = "utf-8" >
< title > Tutorial< / title >
< meta name = "viewport" content = "width=device-width, initial-scale=1" >
< meta http-equiv = "X-UA-Compatible" content = "IE=edge" / >
2015-08-15 13:22:58 -07:00
< link rel = "canonical" href = "https://stedolan.github.io/jq/tutorial/" / >
2015-10-12 12:20:33 -07:00
< link href = "https://maxcdn.bootstrapcdn.com/bootswatch/3.3.5/spacelab/bootstrap.min.css" rel = "stylesheet" integrity = "sha256-j7Dtnd7ZjexEiPNbscbopFn9+Cs0b3TLipKsWAPHZIM= sha512-RFhfi6P8zWMAJrEGU+CPjuxPh3r/UUBGqQ+/o6WKPIVZmQqeOipGotH2ihRULuQ8wsMBoK15TSZqc/7VYWyuIw==" crossorigin = "anonymous" >
2015-08-14 00:04:32 -07:00
< link rel = "stylesheet" href = "/jq/css/base.css" type = "text/css" >
<!-- [if lt IE 9]>
< script src = "https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js" > < / script >
< script src = "https://oss.maxcdn.com/respond/1.4.2/respond.min.js" > < / script >
<![endif]-->
< / head >
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
< body id = "tutorial" >
2015-08-14 00:04:32 -07:00
< div class = "navbar navbar-default navbar-fixed-top" role = "navigation" >
< div class = "container" >
< div class = "navbar-header" >
< button type = "button" class = "navbar-toggle collapsed" data-toggle = "collapse" data-target = "#nav-collapse" >
< span class = "sr-only" > Toggle navigation< / span >
< span class = "icon-bar" > < / span >
< span class = "icon-bar" > < / span >
< span class = "icon-bar" > < / span >
< / button >
< a class = "navbar-brand" href = "/jq/" > jq< / a >
< / div >
2015-08-13 01:15:58 -07:00
2015-08-14 00:04:32 -07:00
< div class = "navbar-collapse collapse" id = "nav-collapse" >
< ul class = "nav navbar-nav" >
< li class = "active" >
< a href = "/jq/tutorial/" > Tutorial< / a >
< / li >
< li >
< a href = "/jq/download/" > Download< / a >
< / li >
< li >
< a href = "/jq/manual/" > Manual< / a >
< / li >
< li > < a href = "https://github.com/stedolan/jq/issues" > Issues< / a > < / li >
< li > < a href = "https://github.com/stedolan/jq" > Source< / a > < / li >
2015-08-15 13:22:58 -07:00
< li > < a href = "https://jqplay.org" > Try online!< / a > < / li >
2015-08-14 00:04:32 -07:00
< li > < a href = "https://raw.githubusercontent.com/stedolan/jq/master/NEWS" > News< / a > < / li >
< / ul >
< / div >
< / div >
2012-09-19 00:40:35 +01:00
< / div >
2015-08-14 00:04:32 -07:00
2012-09-19 00:40:35 +01:00
< div class = "container" >
< div class = "row" >
< h1 > Tutorial< / h1 >
2020-03-02 10:46:27 -05:00
< p > GitHub has a JSON API, so let's play with that. This URL gets us the last
5 commits from the jq repo.< / p >
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
< div class = "tutorial-example" >
< div class = "accordion-heading" >
2020-03-02 10:46:27 -05:00
< pre > curl ' https://api.github.com/repos/stedolan/jq/commits?per_page=5' < / pre >
2012-09-19 00:40:35 +01:00
< a data-toggle = "collapse" href = "#result1" > Show result< / a >
< / div >
2015-08-13 01:15:58 -07:00
< div id = "result1" class = "accordion-body collapse" >
< pre > [
2014-06-08 20:29:54 -05:00
{
2020-03-02 10:46:27 -05:00
" sha" : " d25341478381063d1c76e81b3a52e0592a7c997f" ,
" commit" : {
" author" : {
" name" : " Stephen Dolan" ,
" email" : " mu@netsoc.tcd.ie" ,
" date" : " 2013-06-22T16:30:59Z"
2014-06-08 20:29:54 -05:00
},
2020-03-02 10:46:27 -05:00
" committer" : {
" name" : " Stephen Dolan" ,
" email" : " mu@netsoc.tcd.ie" ,
" date" : " 2013-06-22T16:30:59Z"
2014-06-08 20:29:54 -05:00
},
2020-03-02 10:46:27 -05:00
" message" : " Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161" ,
" tree" : {
" sha" : " 6ab697a8dfb5a96e124666bf6d6213822599fb40" ,
" url" : " https://api.github.com/repos/stedolan/jq/git/trees/6ab697a8dfb5a96e124666bf6d6213822599fb40"
2014-06-08 20:29:54 -05:00
},
2020-03-02 10:46:27 -05:00
" url" : " https://api.github.com/repos/stedolan/jq/git/commits/d25341478381063d1c76e81b3a52e0592a7c997f" ,
" comment_count" : 0
2014-06-08 20:29:54 -05:00
},
2020-03-02 10:46:27 -05:00
" url" : " https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f" ,
" html_url" : " https://github.com/stedolan/jq/commit/d25341478381063d1c76e81b3a52e0592a7c997f" ,
" comments_url" : " https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f/comments" ,
" author" : {
" login" : " stedolan" ,
2015-08-11 22:06:56 -07:00
...
2015-08-13 01:15:58 -07:00
< / pre >
< / div >
2012-09-19 00:40:35 +01:00
< / div >
2020-03-02 10:46:27 -05:00
< p > GitHub returns nicely formatted JSON. For servers that don't, it can be
helpful to pipe the response through jq to pretty-print it. The simplest
jq program is the expression < code > .< / code > , which takes the input and produces it
unchanged as output.< / p >
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
< div class = "tutorial-example" >
< div class = "accordion-heading" >
2020-03-02 10:46:27 -05:00
< pre > curl ' https://api.github.com/repos/stedolan/jq/commits?per_page=5' | jq ' .' < / pre >
2012-09-19 00:40:35 +01:00
< a data-toggle = "collapse" href = "#result2" > Show result< / a >
< / div >
2015-08-13 01:15:58 -07:00
< div id = "result2" class = "accordion-body collapse" >
< pre > [
2014-06-08 20:29:54 -05:00
{
2020-03-02 10:46:27 -05:00
" sha" : " d25341478381063d1c76e81b3a52e0592a7c997f" ,
" commit" : {
" author" : {
" name" : " Stephen Dolan" ,
" email" : " mu@netsoc.tcd.ie" ,
" date" : " 2013-06-22T16:30:59Z"
2014-06-08 20:29:54 -05:00
},
2020-03-02 10:46:27 -05:00
" committer" : {
" name" : " Stephen Dolan" ,
" email" : " mu@netsoc.tcd.ie" ,
" date" : " 2013-06-22T16:30:59Z"
2015-08-11 22:06:56 -07:00
},
2020-03-02 10:46:27 -05:00
" message" : " Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161" ,
" tree" : {
" sha" : " 6ab697a8dfb5a96e124666bf6d6213822599fb40" ,
" url" : " https://api.github.com/repos/stedolan/jq/git/trees/6ab697a8dfb5a96e124666bf6d6213822599fb40"
2015-08-11 22:06:56 -07:00
},
2020-03-02 10:46:27 -05:00
" url" : " https://api.github.com/repos/stedolan/jq/git/commits/d25341478381063d1c76e81b3a52e0592a7c997f" ,
" comment_count" : 0
2015-08-11 22:06:56 -07:00
},
2020-03-02 10:46:27 -05:00
" url" : " https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f" ,
" html_url" : " https://github.com/stedolan/jq/commit/d25341478381063d1c76e81b3a52e0592a7c997f" ,
" comments_url" : " https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f/comments" ,
" author" : {
" login" : " stedolan" ,
2014-06-08 20:29:54 -05:00
...
2015-08-13 01:15:58 -07:00
< / pre >
< / div >
2012-09-19 00:40:35 +01:00
< / div >
2020-03-02 10:46:27 -05:00
< p > We can use jq to extract just the first commit.< / p >
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
< div class = "tutorial-example" >
< div class = "accordion-heading" >
2020-03-02 10:46:27 -05:00
< pre > curl ' https://api.github.com/repos/stedolan/jq/commits?per_page=5' | jq ' .[0]' < / pre >
2012-09-19 00:40:35 +01:00
< a data-toggle = "collapse" href = "#result3" > Show result< / a >
< / div >
2015-08-13 01:15:58 -07:00
< div id = "result3" class = "accordion-body collapse" >
< pre > {
2020-03-02 10:46:27 -05:00
" sha" : " d25341478381063d1c76e81b3a52e0592a7c997f" ,
" commit" : {
" author" : {
" name" : " Stephen Dolan" ,
" email" : " mu@netsoc.tcd.ie" ,
" date" : " 2013-06-22T16:30:59Z"
2014-06-08 20:29:54 -05:00
},
2020-03-02 10:46:27 -05:00
" committer" : {
" name" : " Stephen Dolan" ,
" email" : " mu@netsoc.tcd.ie" ,
" date" : " 2013-06-22T16:30:59Z"
2015-08-11 22:06:56 -07:00
},
2020-03-02 10:46:27 -05:00
" message" : " Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161" ,
" tree" : {
" sha" : " 6ab697a8dfb5a96e124666bf6d6213822599fb40" ,
" url" : " https://api.github.com/repos/stedolan/jq/git/trees/6ab697a8dfb5a96e124666bf6d6213822599fb40"
2015-08-11 22:06:56 -07:00
},
2020-03-02 10:46:27 -05:00
" url" : " https://api.github.com/repos/stedolan/jq/git/commits/d25341478381063d1c76e81b3a52e0592a7c997f" ,
" comment_count" : 0
2015-08-11 22:06:56 -07:00
},
2020-03-02 10:46:27 -05:00
" url" : " https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f" ,
" html_url" : " https://github.com/stedolan/jq/commit/d25341478381063d1c76e81b3a52e0592a7c997f" ,
" comments_url" : " https://api.github.com/repos/stedolan/jq/commits/d25341478381063d1c76e81b3a52e0592a7c997f/comments" ,
" author" : {
" 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
2015-08-11 22:06:56 -07:00
},
2020-03-02 10:46:27 -05:00
" committer" : {
" 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
2014-06-08 20:29:54 -05:00
},
2020-03-02 10:46:27 -05:00
" parents" : [
2015-08-11 22:06:56 -07:00
{
2020-03-02 10:46:27 -05:00
" sha" : " 54b9c9bdb225af5d886466d72f47eafc51acb4f7" ,
" url" : " https://api.github.com/repos/stedolan/jq/commits/54b9c9bdb225af5d886466d72f47eafc51acb4f7" ,
" html_url" : " https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7"
2014-06-08 20:29:54 -05:00
},
2015-08-11 22:06:56 -07:00
{
2020-03-02 10:46:27 -05:00
" sha" : " 8b1b503609c161fea4b003a7179b3fbb2dd4345a" ,
" url" : " https://api.github.com/repos/stedolan/jq/commits/8b1b503609c161fea4b003a7179b3fbb2dd4345a" ,
" html_url" : " https://github.com/stedolan/jq/commit/8b1b503609c161fea4b003a7179b3fbb2dd4345a"
2014-06-08 20:29:54 -05:00
}
2015-08-11 22:06:56 -07:00
]
2014-06-08 20:29:54 -05:00
}
2015-08-13 01:15:58 -07:00
< / pre >
< / div >
2012-09-19 00:40:35 +01:00
< / div >
2020-03-02 10:46:27 -05:00
< p > For the rest of the examples, I'll leave out the < code > curl< / code > command - it's not
going to change.< / p >
< p > There's a lot of info we don't care about there, so we'll restrict it down
to the most interesting fields.< / p >
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
< div class = "tutorial-example" >
< div class = "accordion-heading" >
2020-03-02 10:46:27 -05:00
< pre > jq ' .[0] | {message: .commit.message, name: .commit.committer.name}' < / pre >
2012-09-19 00:40:35 +01:00
< a data-toggle = "collapse" href = "#result4" > Show result< / a >
< / div >
2015-08-13 01:15:58 -07:00
< div id = "result4" class = "accordion-body collapse" >
< pre > {
2020-03-02 10:46:27 -05:00
" message" : " Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161" ,
" name" : " Stephen Dolan"
2012-09-19 00:40:35 +01:00
}
2015-08-13 01:15:58 -07:00
< / pre >
< / div >
2012-09-19 00:40:35 +01:00
< / div >
2020-03-02 10:46:27 -05:00
< p > The < code > |< / code > operator in jq feeds the output of one filter (< code > .[0]< / code > which gets
the first element of the array in the response) into the input of another
(< code > {...}< / code > which builds an object out of those fields). You can access
nested attributes, such as < code > .commit.message< / code > .< / p >
< p > Now let's get the rest of the commits.< / p >
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
< div class = "tutorial-example" >
< div class = "accordion-heading" >
2020-03-02 10:46:27 -05:00
< pre > jq ' .[] | {message: .commit.message, name: .commit.committer.name}' < / pre >
2012-09-19 00:40:35 +01:00
< a data-toggle = "collapse" href = "#result5" > Show result< / a >
< / div >
2015-08-13 01:15:58 -07:00
< div id = "result5" class = "accordion-body collapse" >
< pre > {
2020-03-02 10:46:27 -05:00
" message" : " Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161" ,
" name" : " Stephen Dolan"
2012-09-19 00:40:35 +01:00
}
{
2020-03-02 10:46:27 -05:00
" message" : " Reject all overlong UTF8 sequences." ,
" name" : " Stephen Dolan"
2012-09-19 00:40:35 +01:00
}
{
2020-03-02 10:46:27 -05:00
" message" : " Fix various UTF8 parsing bugs.\n\nIn particular, parse bad UTF8 by replacing the broken bits with U+FFFD\nand resychronise correctly after broken sequences." ,
" name" : " Stephen Dolan"
2012-09-19 00:40:35 +01:00
}
{
2020-03-02 10:46:27 -05:00
" message" : " Fix example in manual for `floor`. See #155." ,
" name" : " Stephen Dolan"
2012-09-19 00:40:35 +01:00
}
{
2020-03-02 10:46:27 -05:00
" message" : " Document floor" ,
" name" : " Nicolas Williams"
2012-09-19 00:40:35 +01:00
}
2015-08-13 01:15:58 -07:00
< / pre >
< / div >
2012-09-19 00:40:35 +01:00
< / div >
2020-03-02 10:46:27 -05:00
< p > < code > .[]< / code > returns each element of the array returned in the response, one at a
time, which are all fed into
< code > {message: .commit.message, name: .commit.committer.name}< / code > .< / p >
< p > Data in jq is represented as streams of JSON values - every jq
expression runs for each value in its input stream, and can
produce any number of values to its output stream.< / p >
< p > Streams are serialised by just separating JSON values with
whitespace. This is a < code > cat< / code > -friendly format - you can just join
two JSON streams together and get a valid JSON stream.< / p >
< p > If you want to get the output as a single array, you can tell jq to
"collect" all of the answers by wrapping the filter in square
brackets:< / p >
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
< div class = "tutorial-example" >
< div class = "accordion-heading" >
2020-03-02 10:46:27 -05:00
< pre > jq ' [.[] | {message: .commit.message, name: .commit.committer.name}]' < / pre >
2012-09-19 00:40:35 +01:00
< a data-toggle = "collapse" href = "#result6" > Show result< / a >
< / div >
2015-08-13 01:15:58 -07:00
< div id = "result6" class = "accordion-body collapse" >
< pre > [
2012-09-19 00:40:35 +01:00
{
2020-03-02 10:46:27 -05:00
" message" : " Merge pull request #163 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161" ,
" name" : " Stephen Dolan"
2012-09-19 00:40:35 +01:00
},
{
2020-03-02 10:46:27 -05:00
" message" : " Reject all overlong UTF8 sequences." ,
" name" : " Stephen Dolan"
2012-09-19 00:40:35 +01:00
},
{
2020-03-02 10:46:27 -05:00
" message" : " Fix various UTF8 parsing bugs.\n\nIn particular, parse bad UTF8 by replacing the broken bits with U+FFFD\nand resychronise correctly after broken sequences." ,
" name" : " Stephen Dolan"
2012-09-19 00:40:35 +01:00
},
{
2020-03-02 10:46:27 -05:00
" message" : " Fix example in manual for `floor`. See #155." ,
" name" : " Stephen Dolan"
2012-09-19 00:40:35 +01:00
},
{
2020-03-02 10:46:27 -05:00
" message" : " Document floor" ,
" name" : " Nicolas Williams"
2012-09-19 00:40:35 +01:00
}
]
2015-08-13 01:15:58 -07:00
< / pre >
< / div >
2012-09-19 00:40:35 +01:00
< / div >
< hr / >
2020-03-02 10:46:27 -05:00
< p > Next, let's try getting the URLs of the parent commits out of the
API results as well. In each commit, the GitHub API includes information
about "parent" commits. There can be one or many.< / p >
< pre > < code > "parents": [
2014-06-08 20:29:54 -05:00
{
2020-03-02 10:46:27 -05:00
"sha": "54b9c9bdb225af5d886466d72f47eafc51acb4f7",
"url": "https://api.github.com/repos/stedolan/jq/commits/54b9c9bdb225af5d886466d72f47eafc51acb4f7",
"html_url": "https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7"
2014-06-08 20:29:54 -05:00
},
{
2020-03-02 10:46:27 -05:00
"sha": "8b1b503609c161fea4b003a7179b3fbb2dd4345a",
"url": "https://api.github.com/repos/stedolan/jq/commits/8b1b503609c161fea4b003a7179b3fbb2dd4345a",
"html_url": "https://github.com/stedolan/jq/commit/8b1b503609c161fea4b003a7179b3fbb2dd4345a"
2014-06-08 20:29:54 -05:00
}
2020-03-02 10:46:27 -05:00
]
< / code > < / pre >
< p > We want to pull out all of the "html_url" fields inside that array of parent
commits and make a simple list of strings to go along with the
"message" and "author" fields we already have.< / p >
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
< div class = "tutorial-example" >
< div class = "accordion-heading" >
2020-03-02 10:46:27 -05:00
< pre > jq ' [.[] | {message: .commit.message, name: .commit.committer.name, parents: [.parents[].html_url]}]' < / pre >
2012-09-19 00:40:35 +01:00
< a data-toggle = "collapse" href = "#result7" > Show result< / a >
< / div >
2015-08-13 01:15:58 -07:00
< div id = "result7" class = "accordion-body collapse" >
< pre > [
2014-06-08 20:29:54 -05:00
{
2020-03-02 10:46:27 -05:00
" message" : " Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161" ,
" name" : " Stephen Dolan" ,
" parents" : [
" https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7" ,
" https://github.com/stedolan/jq/commit/8b1b503609c161fea4b003a7179b3fbb2dd4345a"
2015-08-11 22:06:56 -07:00
]
2014-06-08 20:29:54 -05:00
},
{
2020-03-02 10:46:27 -05:00
" message" : " Reject all overlong UTF8 sequences." ,
" name" : " Stephen Dolan" ,
" parents" : [
" https://github.com/stedolan/jq/commit/ff48bd6ec538b01d1057be8e93b94eef6914e9ef"
2015-08-11 22:06:56 -07:00
]
2014-06-08 20:29:54 -05:00
},
{
2020-03-02 10:46:27 -05:00
" message" : " Fix various UTF8 parsing bugs.\n\nIn particular, parse bad UTF8 by replacing the broken bits with U+FFFD\nand resychronise correctly after broken sequences." ,
" name" : " Stephen Dolan" ,
" parents" : [
" https://github.com/stedolan/jq/commit/54b9c9bdb225af5d886466d72f47eafc51acb4f7"
2015-08-11 22:06:56 -07:00
]
2014-06-08 20:29:54 -05:00
},
{
2020-03-02 10:46:27 -05:00
" message" : " Fix example in manual for `floor`. See #155." ,
" name" : " Stephen Dolan" ,
" parents" : [
" https://github.com/stedolan/jq/commit/3dcdc582ea993afea3f5503a78a77675967ecdfa"
2015-08-11 22:06:56 -07:00
]
2014-06-08 20:29:54 -05:00
},
{
2020-03-02 10:46:27 -05:00
" message" : " Document floor" ,
" name" : " Nicolas Williams" ,
" parents" : [
" https://github.com/stedolan/jq/commit/7c4171d414f647ab08bcd20c76a4d8ed68d9c602"
2015-08-11 22:06:56 -07:00
]
2014-06-08 20:29:54 -05:00
}
]
2015-08-13 01:15:58 -07:00
< / pre >
< / div >
2012-09-19 00:40:35 +01:00
< / div >
2020-03-02 10:46:27 -05:00
< p > Here we're making an object as before, but this time the < code > parents< / code >
field is being set to < code > [.parents[].html_url]< / code > , which collects
all of the parent commit URLs defined in the parents object.< / p >
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
< hr / >
2020-03-02 10:46:27 -05:00
< p > Here endeth the tutorial! There's lots more to play with. Go
read < a href = "../manual/" > the manual< / a > if you're interested, and < a href = "../download/" > download
jq< / a > if you haven't already.< / p >
2012-09-19 00:40:35 +01:00
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
< / div >
< / div >
2015-08-13 01:15:58 -07:00
2012-09-19 00:40:35 +01:00
< footer >
2015-08-14 00:04:32 -07:00
< div class = "container" >
2020-03-02 10:46:27 -05:00
< p > This website is made with < a href = "http://getbootstrap.com" > Bootstrap< / a > , themed with < a href = "https://bootswatch.com" > Bootswatch< / a > .< / p >
2015-08-15 13:22:58 -07:00
< p > jq is licensed under the MIT license (code) and the < a href = "https://creativecommons.org/licenses/by/3.0/" > CC-BY-3.0< / a > license (docs).< / p >
2015-08-14 00:04:32 -07:00
< / div >
< / footer >
< script src = "https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" > < / script >
2015-10-12 12:20:33 -07:00
< script src = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity = "sha256-Sk3nkD6mLTMOF0EOpNtsIry+s1CsaqQC1rVLTAy+0yc= sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin = "anonymous" > < / script >
< script src = "https://twitter.github.io/typeahead.js/releases/0.11.1/typeahead.bundle.js" > < / script >
2012-09-19 00:40:35 +01:00
< / body >
2020-03-02 10:46:27 -05:00
< / html >