]> granicus.if.org Git - jq/log
jq
7 years agoMake configure.ac work for shallow clones
Nicolas Williams [Sun, 5 Mar 2017 04:57:14 +0000 (22:57 -0600)]
Make configure.ac work for shallow clones

7 years agoMake scripts/version work in shallow clones
Nicolas Williams [Fri, 3 Mar 2017 20:28:58 +0000 (14:28 -0600)]
Make scripts/version work in shallow clones

Shallow clones don't have tags.  Use git describe --always --dirty in
such cases.

XXX Add branch name.

7 years agoFix make dist
Nicolas Williams [Thu, 2 Mar 2017 05:01:08 +0000 (23:01 -0600)]
Fix make dist

7 years agoFix off-by-one bug in #1108 fix
Nicolas Williams [Thu, 2 Mar 2017 04:45:02 +0000 (22:45 -0600)]
Fix off-by-one bug in #1108 fix

7 years agoArray slice overflows (fix #1108)
Nicolas Williams [Wed, 1 Mar 2017 23:35:08 +0000 (17:35 -0600)]
Array slice overflows (fix #1108)

7 years agogetpath/1 should be a path expression (fix #1358) 1359/head
Nicolas Williams [Wed, 1 Mar 2017 03:39:54 +0000 (21:39 -0600)]
getpath/1 should be a path expression (fix #1358)

It needs to be possible to do something like

    getpath($paths[]) += 1

meaning: increment all the paths in . that are listed in $paths[].

In order to do this getpath() needs to update the jq->path and
jq->value_at_path as necessary.

7 years agoFix name of builtins in the builtins/0 output
William Langford [Mon, 27 Feb 2017 00:50:10 +0000 (19:50 -0500)]
Fix name of builtins in the builtins/0 output

7 years agoFix warning about environ
Nicolas Williams [Mon, 27 Feb 2017 00:22:30 +0000 (18:22 -0600)]
Fix warning about environ

7 years agoFix --without-oniguruma build
Nicolas Williams [Mon, 27 Feb 2017 00:22:23 +0000 (18:22 -0600)]
Fix --without-oniguruma build

7 years agoFix environ Win32 build problem
Nicolas Williams [Mon, 27 Feb 2017 00:06:35 +0000 (18:06 -0600)]
Fix environ Win32 build problem

7 years agoAdd `halt`, `halt_error` builtins (fix #386) 1348/head
Nicolas Williams [Thu, 23 Feb 2017 05:01:56 +0000 (23:01 -0600)]
Add `halt`, `halt_error` builtins (fix #386)

7 years agoDocument `stderr`
Nicolas Williams [Thu, 23 Feb 2017 05:01:39 +0000 (23:01 -0600)]
Document `stderr`

7 years agoFix memory leak
Nicolas Williams [Sun, 26 Feb 2017 22:32:43 +0000 (16:32 -0600)]
Fix memory leak

7 years agoFix Appveyor for non-master branches 1353/head
Nicolas Williams [Sun, 26 Feb 2017 22:13:22 +0000 (16:13 -0600)]
Fix Appveyor for non-master branches

7 years agofixup
Nicolas Williams [Sun, 26 Feb 2017 22:12:57 +0000 (16:12 -0600)]
fixup

7 years agoAdd $ENV builtin variable to access environment
Nicolas Williams [Sun, 26 Feb 2017 06:28:12 +0000 (00:28 -0600)]
Add $ENV builtin variable to access environment

7 years agoFix error message for undefined vars
Nicolas Williams [Sun, 26 Feb 2017 06:25:09 +0000 (00:25 -0600)]
Fix error message for undefined vars

7 years agoPreserve precious vars in configure.ac (fix #795)
Nicolas Williams [Sun, 26 Feb 2017 03:49:38 +0000 (21:49 -0600)]
Preserve precious vars in configure.ac (fix #795)

7 years agoDocument $ARGS and friends
Nicolas Williams [Sun, 26 Feb 2017 01:21:06 +0000 (19:21 -0600)]
Document $ARGS and friends

7 years agoAdd $ARGS, --args and --jsonargs (fix #1345) 1346/head
Nicolas Williams [Mon, 20 Feb 2017 00:11:18 +0000 (18:11 -0600)]
Add $ARGS, --args and --jsonargs (fix #1345)

7 years agojq_compile_args(): allow object args to be object
Nicolas Williams [Mon, 20 Feb 2017 00:08:03 +0000 (18:08 -0600)]
jq_compile_args(): allow object args to be object

7 years agoAdd jv_object_has()
Nicolas Williams [Mon, 20 Feb 2017 00:05:38 +0000 (18:05 -0600)]
Add jv_object_has()

7 years agoMake test/shtest test of constant folding robust
Nicolas Williams [Mon, 20 Feb 2017 00:23:36 +0000 (18:23 -0600)]
Make test/shtest test of constant folding robust

Rather than testing that a constant expression produces so many
instructions, test that a variety of of such expressions produce the
same number of instructions.  This will make future changes in the
compiler less likely to break this test.

7 years agoImprove Appveyor build
Nicolas Williams [Sat, 25 Feb 2017 20:30:14 +0000 (14:30 -0600)]
Improve Appveyor build

Among other things, make TESTS=... breaks when using modules/oniguruma,
so set SUBDIRS= then.

7 years agoWindows: configure fails to detect missing math
Nicolas Williams [Sun, 26 Feb 2017 00:22:24 +0000 (18:22 -0600)]
Windows: configure fails to detect missing math

For some reason AC_CHECK_MATH_FUNC() on Windows is not detecting a
handful of math functions as not being supported.  This commit is a bit
of a hack.

7 years agoMake comment consistent with code
Nicolas Williams [Sat, 25 Feb 2017 20:24:43 +0000 (14:24 -0600)]
Make comment consistent with code

7 years agoDon't call SetConsoleOutputCP
Yasuhiro Matsumoto [Fri, 1 Apr 2016 05:53:38 +0000 (14:53 +0900)]
Don't call SetConsoleOutputCP

Should use wide-string function instead of SetConsoleOutputCP.

Fixes #1121

7 years agoQuiet a compiler warning
Yasuhiro Matsumoto [Fri, 1 Apr 2016 05:53:12 +0000 (14:53 +0900)]
Quiet a compiler warning

7 years agoWindows: Also use -lshlwapi for jq(1)
Nicolas Williams [Sat, 25 Feb 2017 20:15:18 +0000 (14:15 -0600)]
Windows: Also use -lshlwapi for jq(1)

7 years agoWhen using builtin Oniguruma, set flags correctly
Nicolas Williams [Sat, 25 Feb 2017 20:02:03 +0000 (14:02 -0600)]
When using builtin Oniguruma, set flags correctly

This should fix the Travis-CI build.

7 years agoDocument `localtime` and `strflocaltime`
Nicolas Williams [Fri, 24 Feb 2017 05:39:24 +0000 (23:39 -0600)]
Document `localtime` and `strflocaltime`

7 years agoAdd `localtime` and `strflocaltime` (fix #1349)
Nicolas Williams [Fri, 24 Feb 2017 04:26:53 +0000 (22:26 -0600)]
Add `localtime` and `strflocaltime` (fix #1349)

7 years agoImprove manual section on assignment forms
Nicolas Williams [Fri, 24 Feb 2017 04:17:54 +0000 (22:17 -0600)]
Improve manual section on assignment forms

7 years agoRevert e7caf68 for Dockerfile
Nicolas Williams [Fri, 24 Feb 2017 04:01:43 +0000 (22:01 -0600)]
Revert e7caf68 for Dockerfile

7 years agoAttempt to use builtin Oniguruma for CIs
Nicolas Williams [Thu, 23 Feb 2017 06:33:08 +0000 (00:33 -0600)]
Attempt to use builtin Oniguruma for CIs

7 years agoAllow ./configure --with-oniguruma=builtin
Nicolas Williams [Thu, 23 Feb 2017 06:30:13 +0000 (00:30 -0600)]
Allow ./configure --with-oniguruma=builtin

This allows one to force the use of jq's builtin copy of Oniguruma
(builtin as a git submodule).

We still need to fix make dist to include that copy of Oniguruma.

7 years agoAllow var bindings in path expressions (#1347)
Nicolas Williams [Wed, 22 Feb 2017 00:11:35 +0000 (18:11 -0600)]
Allow var bindings in path expressions (#1347)

The expression in a variable binding is not and must not be seen as
being part of a path expression in which the variable binding appears.

7 years agoAdd local oniguruma submodule
Erik Brinkman [Fri, 27 Jan 2017 04:29:00 +0000 (23:29 -0500)]
Add local oniguruma submodule

Configure should still allow use of prebuilt onigurumas (whether
system-installed or in a special prefix).  If these are not found, and
configure was not called with `--without-oniguruma`, then use the vendored
oniguruma module.  If configure was called with `--without-oniguruma`, then we
do not build regex functionality into jq.

7 years agoImprove manual 1340/head
Nicolas Williams [Wed, 15 Feb 2017 05:37:35 +0000 (23:37 -0600)]
Improve manual

7 years agoAdd `builtins` builtin
William Langford [Sun, 5 Feb 2017 06:28:15 +0000 (01:28 -0500)]
Add `builtins` builtin

7 years agoFix memory leak in libm cfunctions
William Langford [Sun, 5 Feb 2017 05:47:19 +0000 (00:47 -0500)]
Fix memory leak in libm cfunctions

7 years agoMerge pull request #1089 from l8nite/base64_decode
William Langford [Sun, 12 Feb 2017 21:25:44 +0000 (16:25 -0500)]
Merge pull request #1089 from l8nite/base64_decode

7 years agoAdd @base64d for decoding base64 #47
Shaun Guth [Sun, 24 Jan 2016 23:30:28 +0000 (23:30 +0000)]
Add @base64d for decoding base64 #47

7 years agofix truncate_stream to match docs
J Phani Mahesh [Tue, 7 Feb 2017 08:44:29 +0000 (14:14 +0530)]
fix truncate_stream to match docs

7 years agoAdd more missing math functions 1328/head
Nicolas Williams [Sat, 4 Feb 2017 06:11:19 +0000 (00:11 -0600)]
Add more missing math functions

7 years agoFix handling of unsupported math functions
Nicolas Williams [Sat, 4 Feb 2017 06:11:10 +0000 (00:11 -0600)]
Fix handling of unsupported math functions

7 years agoPromote wiki more in README
Nicolas Williams [Tue, 31 Jan 2017 22:13:32 +0000 (16:13 -0600)]
Promote wiki more in README

7 years agoImprove docs somewhat, inspired by #1326
Nicolas Williams [Sat, 28 Jan 2017 18:30:57 +0000 (12:30 -0600)]
Improve docs somewhat, inspired by #1326

7 years agoMake |= delete LHS when RHS is empty (Fix #1314)
Nicolas Williams [Fri, 27 Jan 2017 23:46:00 +0000 (17:46 -0600)]
Make |= delete LHS when RHS is empty (Fix #1314)

Now that #1313 is fixed, |= no longer outputs null when the RHS update
expression outputs empty.

When a user wants to keep the current value of the LHS they would have
the RHS update expression output `.`, so having `empty` achieve the same
thing would be redundant.  The obvious thing to do is to delete the LHS
when the RHS update outputs `empty` (i.e., doesn't output any values).

It's reasonable to think that existing programs won't be broken by this
change, because reduce and |= not handling empty well is clearly a bug.
(Though it's possible that some programs were using empty to quickly
terminate reduce or |=, it's not likely.  They should use label/break
instead.)

Prior to this change |= would use the _last_ value output by the RHS
update expression.  With this change |= will use the _first_ value
instead.  This change _is_ a minor backwards-incompatible change.  It
may or may not be acceptable; we'll see.  It is a useful change in that
it makes |= faster when the update expression produces multiple values.

7 years agorecurse (i.e., ..) needs to find leaf nulls
Nicolas Williams [Fri, 27 Jan 2017 21:51:06 +0000 (15:51 -0600)]
recurse (i.e., ..) needs to find leaf nulls

7 years agoAdd SQL-style operators (#1322)
Nicolas Williams [Fri, 27 Jan 2017 16:06:04 +0000 (10:06 -0600)]
Add SQL-style operators (#1322)

7 years agoMake first(g) more efficient: extract only 1 value
Nicolas Williams [Fri, 27 Jan 2017 15:48:13 +0000 (09:48 -0600)]
Make first(g) more efficient: extract only 1 value

first(g) was extracting two values, which, if g is slow, made first(g)
slow.  And if the second extraction were to throw an error, then
first(g) would throw that error, which is clearly not the right thing to
do.  Besides that, first(g) was allocating garbage, which it no longer
does.

7 years agoreduce: handle empty updates (fix #1313)
Nicolas Williams [Mon, 23 Jan 2017 23:10:51 +0000 (17:10 -0600)]
reduce: handle empty updates (fix #1313)

7 years agoSolaris needs XPG6 for c99
Attila Fülöp [Wed, 10 Aug 2016 20:27:21 +0000 (22:27 +0200)]
Solaris needs XPG6 for c99

7 years agoMerge pull request #1317 from wtlangford/dont-split-utf8-sequences
William Langford [Sat, 28 Jan 2017 02:45:15 +0000 (21:45 -0500)]
Merge pull request #1317 from wtlangford/dont-split-utf8-sequences

Handle cut-off UTF-8 sequences when reading files

7 years agoHandle cut-off UTF-8 sequences when reading files 1317/head
William Langford [Wed, 25 Jan 2017 04:05:47 +0000 (23:05 -0500)]
Handle cut-off UTF-8 sequences when reading files

Read additional bytes from the file to complete the UTF-8 sequence so the bytes
in it don't get converted to U+FFFD replacement characters.

7 years agoParse no deeper than MAX_PARSING_DEPTH
W-Mark Kubacki [Fri, 19 Aug 2016 18:10:21 +0000 (20:10 +0200)]
Parse no deeper than MAX_PARSING_DEPTH

    while true; do printf '{"deeper": '; done | jq .

7 years agoSkip printing what's below a MAX_PRINT_DEPTH
W-Mark Kubacki [Fri, 19 Aug 2016 17:50:39 +0000 (19:50 +0200)]
Skip printing what's below a MAX_PRINT_DEPTH

This addresses #1136, and mitigates a stack exhaustion when printing
a very deeply nested term.

7 years agogen_utf8_tables: remove unused variable
Jakub Wilk [Thu, 26 Jan 2017 18:42:59 +0000 (19:42 +0100)]
gen_utf8_tables: remove unused variable

7 years agoRevert "Disable appveyor build for now"
Jan Schulz [Thu, 14 Apr 2016 16:22:16 +0000 (18:22 +0200)]
Revert "Disable appveyor build for now"

This reverts commit 0b8218515eabf1a967eba0dbcc7a0e5ae031a509.

There is a new oniguruma package which previously trashed the build.

7 years agoTypo fixed
Richard Groves [Thu, 7 Jul 2016 09:05:42 +0000 (10:05 +0100)]
Typo fixed

simply -> simple

7 years agoDocumentation clarification suggestions
Janne Cederberg [Sun, 10 Apr 2016 05:34:44 +0000 (08:34 +0300)]
Documentation clarification suggestions

7 years agoUpdate download instructions for Arch
James Pearson Hughes [Thu, 14 Apr 2016 23:56:21 +0000 (16:56 -0700)]
Update download instructions for Arch

jq has been in the community repo for [just over a year now][0].

[0]: https://projects.archlinux.org/svntogit/community.git/commit/trunk?h=packages/jq&id=8d5e06065bc92bf56ea651970c9bda07fb545554

7 years agoTypo: s/more/mode/ in `--seq`
Tim McCormack [Fri, 4 Nov 2016 20:21:39 +0000 (16:21 -0400)]
Typo: s/more/mode/ in `--seq`

7 years agoFix input_(line_number|filename) leak memory
Clément MATHIEU [Tue, 3 Jan 2017 21:19:58 +0000 (22:19 +0100)]
Fix input_(line_number|filename) leak memory

7 years agoFix cross-compile tmp dir removal
Jay Satiro [Sat, 22 Oct 2016 20:00:44 +0000 (16:00 -0400)]
Fix cross-compile tmp dir removal

- cd out of the tmp dir before attempting to remove it.

8 years agoDisable appveyor build for now 1178/head
Nicolas Williams [Mon, 21 Mar 2016 22:43:01 +0000 (17:43 -0500)]
Disable appveyor build for now

8 years agoRemove David from maintainers
David Tolnay [Wed, 24 Feb 2016 08:39:56 +0000 (00:39 -0800)]
Remove David from maintainers

8 years agoTravis-CI build for OSX (fix #1083) 1086/head
Nicolas Williams [Mon, 18 Jan 2016 20:58:58 +0000 (14:58 -0600)]
Travis-CI build for OSX (fix #1083)

8 years agoAlways test sort_by/group_by post-#1082 1084/head
Nicolas Williams [Mon, 18 Jan 2016 18:17:58 +0000 (12:17 -0600)]
Always test sort_by/group_by post-#1082

8 years agoMake jv_sort stable regardless of qsort details. qsort-stability 1082/head
Stephen Dolan [Mon, 18 Jan 2016 10:56:54 +0000 (10:56 +0000)]
Make jv_sort stable regardless of qsort details.

8 years agoAdd AppVeyor badge to README.md
Stephen Dolan [Mon, 18 Jan 2016 10:15:43 +0000 (10:15 +0000)]
Add AppVeyor badge to README.md

Thanks @JanSchulz, @nicowilliams!

8 years agoAdd --enable-ubsan (undefined behavior sanitizer) 1081/head
Nicolas Williams [Sun, 17 Jan 2016 18:09:43 +0000 (12:09 -0600)]
Add --enable-ubsan (undefined behavior sanitizer)

8 years agoRun failing tests on Windows; ignore failures
Nicolas Williams [Sun, 17 Jan 2016 18:38:35 +0000 (12:38 -0600)]
Run failing tests on Windows; ignore failures

8 years agoMake it possible to run tests with set -x
Nicolas Williams [Sun, 17 Jan 2016 18:23:05 +0000 (12:23 -0600)]
Make it possible to run tests with set -x

One can now run:

    make TRACE_TESTS=1 check

to get detailed output

8 years agoEnable more tests on Windows; move sort_by tests
Nicolas Williams [Sun, 17 Jan 2016 17:23:17 +0000 (11:23 -0600)]
Enable more tests on Windows; move sort_by tests

Use %%FAIL IGNORE MSG for error messages that differ on Windows, and
move the sort_by/group_by tests that fail qhen qsort() is not stable.

Now only tests/sorttest and tests/shtest are disabled on Windows.

8 years agoTweak appveyor.yml; disable failing tests 1080/head
Nicolas Williams [Sun, 17 Jan 2016 07:49:50 +0000 (01:49 -0600)]
Tweak appveyor.yml; disable failing tests

8 years agoUpload build failure logs 1076/head
Jan Schulz [Sat, 16 Jan 2016 21:39:55 +0000 (22:39 +0100)]
Upload build failure logs

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
8 years agoBuild a html help
Jan Schulz [Sat, 16 Jan 2016 21:55:13 +0000 (22:55 +0100)]
Build a html help

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
8 years agoRun tests on appveyor
Jan Schulz [Sat, 16 Jan 2016 21:24:38 +0000 (22:24 +0100)]
Run tests on appveyor

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
8 years agoAdd 32bit windows builds on appveyor
Jan Schulz [Sat, 16 Jan 2016 21:20:23 +0000 (22:20 +0100)]
Add 32bit windows builds on appveyor

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
8 years agoBuild on windows (mingw) on appveyor
Jan Schulz [Sat, 16 Jan 2016 11:44:34 +0000 (12:44 +0100)]
Build on windows (mingw) on appveyor

For this to work, one of the core commiter should do:

* enable appveyor in the github project (grant access)
* Make an appveyor account and add the github jq repo as a new project

inspirations from:

appveyor, msys2, use bash environment to build...
* https://github.com/ariscop/elemental-ircd/blob/appveyor/appveyor.yml
* https://github.com/khaledhosny/ots/pull/67/files
* https://github.com/universal-ctags/ctags/blob/master/appveyor.yml
* https://github.com/universal-ctags/ctags/blob/master/win32/appveyor.bat

and with mvsc
* https://github.com/khaledhosny/ots/blob/master/.appveyor.yml

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
8 years agoFix cross-compilation build 1073/head
Nicolas Williams [Fri, 15 Jan 2016 22:21:16 +0000 (16:21 -0600)]
Fix cross-compilation build

8 years agoFix Windows build (fix #911)
Nicolas Williams [Fri, 15 Jan 2016 22:06:30 +0000 (16:06 -0600)]
Fix Windows build (fix #911)

8 years agofixup non-maintainer build
Nicolas Williams [Fri, 15 Jan 2016 22:06:18 +0000 (16:06 -0600)]
fixup non-maintainer build

8 years agoAlways build src/builtin.inc (fix #1069)
Nicolas Williams [Fri, 15 Jan 2016 17:59:14 +0000 (11:59 -0600)]
Always build src/builtin.inc (fix #1069)

8 years agoMultiByteToWideChar() usage bug (fix #1072)
Nicolas Williams [Fri, 15 Jan 2016 17:58:41 +0000 (11:58 -0600)]
MultiByteToWideChar() usage bug (fix #1072)

9 years agoMake it easier to use jq with shebangs (fix #1044)
Nicolas Williams [Tue, 15 Dec 2015 05:43:22 +0000 (23:43 -0600)]
Make it easier to use jq with shebangs (fix #1044)

Allow a continuation on a comment immediately after a shebang to make
this traditional hack possible:

    #!/bin/sh
    # this next line is ignored by jq \
    exec jq -f "$0" "$@"
    # jq code follows

But continue only on the first line following a shebang, and only if
it's a comment.

9 years agoAdd note about IEEE754 to help msg
Nicolas Williams [Tue, 15 Dec 2015 06:00:03 +0000 (00:00 -0600)]
Add note about IEEE754 to help msg

9 years agoChange usage formatting
Cameron Sparr [Fri, 11 Dec 2015 21:35:57 +0000 (14:35 -0700)]
Change usage formatting

9 years agoAvoiding conditional directives that break statements
Romero Malaquias [Wed, 9 Dec 2015 06:38:17 +0000 (03:38 -0300)]
Avoiding conditional directives that break statements

9 years agoTwo sub bugs fixed; two new gsub tests have been added.
pkoppstein [Mon, 7 Dec 2015 23:51:26 +0000 (18:51 -0500)]
Two sub bugs fixed; two new gsub tests have been added.
./jq --run-tests < tests/onig.test
has been run successfully:

...
Testing 'gsub("a";"b")' at line number 70
Testing 'gsub( "(.*)"; "";  "x")' at line number 74
...
22 of 22 tests passed (0 malformed)

9 years agoFix JV_OBJECT() and go up to 18 1031/head
Nicolas Williams [Wed, 2 Dec 2015 05:25:23 +0000 (23:25 -0600)]
Fix JV_OBJECT() and go up to 18

9 years agoAssume . if either stdin/on isatty() (fix #1028) 1030/head
Nicolas Williams [Wed, 2 Dec 2015 04:16:03 +0000 (22:16 -0600)]
Assume . if either stdin/on isatty() (fix #1028)

And move the #define of isatty on Windows up.

9 years agoyum has been replaced with dnf as of f22 1024/head
Mark McKinstry [Thu, 26 Nov 2015 15:48:06 +0000 (10:48 -0500)]
yum has been replaced with dnf as of f22

https://fedoraproject.org/wiki/Changes/ReplaceYumWithDNF

9 years agoSupport --without-oniguruma 1022/head
David Tolnay [Sat, 21 Nov 2015 18:05:37 +0000 (10:05 -0800)]
Support --without-oniguruma

9 years agoOniguruma hash in dockerfile
David Tolnay [Wed, 18 Nov 2015 08:30:18 +0000 (00:30 -0800)]
Oniguruma hash in dockerfile

9 years agoFix manual signature for split (non-regex) 1018/head
Loamhoof [Sun, 15 Nov 2015 20:43:38 +0000 (21:43 +0100)]
Fix manual signature for split (non-regex)

9 years agoAdd address sanitizer (ASAN) support (fix #1002) 1004/head
Nicolas Williams [Wed, 28 Oct 2015 00:01:06 +0000 (19:01 -0500)]
Add address sanitizer (ASAN) support (fix #1002)

9 years agoSupport numbers and boolean in join (fix #930)
David Tolnay [Sun, 18 Oct 2015 05:44:40 +0000 (22:44 -0700)]
Support numbers and boolean in join (fix #930)