Repository navigation
Releases: codedeviate/trg
Releases · codedeviate/trg
Release list
targrep 0.10.0
Added
.ziparchives, through thestuffr-formatscrate's zip container. A
zip's members are searched like a tar's: per-member line numbers,-g,
-T, binary detection, and one level of compression inside a member
(access.log.1.gzin a zip). Stored, deflate, deflate64, bzip2, LZMA, xz
and PPMd members are read. An encrypted member, a damaged one (CRC
mismatch), or records the archive cannot account for are reported and
make the run a 2. The members after an encrypted one are still searched.- Unix
compress(.Z,.tar.Z), through stuffr's decoder. Only as a
whole file: a.Zmember inside an archive is reported unread (exit 2)
rather than searched as binary..Zrecords neither its length nor a checksum, so a truncated one reads
as a shorter file with no error. A.Zwith no match is still a 1, but
trg prints a note on stderr saying the file could not vouch for its own
end.
Fixed
- Errors from inside an archive did not say which archive: a sweep of a
month of logs could printtrg: tar entry: unexpected end of fileand
leave you to find it. Every such diagnostic now starts with the archive's
path.
targrep 0.9.0
Added
- bzip2 and lz4, detected from content like the other formats:
.tar.bz2,
.tar.lz4, bare.bz2and.lz4logs, and.bz2or.lz4members inside
any archive, one level deep. Both decoders are pure Rust, so the static
Linux builds gain no C dependency.- bzip2 reads every stream in the file, so archives written by pbzip2 or
lbzip2 (one stream per chunk) are read to the end. - lz4 reads every frame in the file (
cat a.lz4 b.lz4), the legacy
lz4 -lformat, and steps over a leading skippable frame. A skippable
frame between two data frames is reported as an error (exit 2).
- bzip2 reads every stream in the file, so archives written by pbzip2 or
targrep 0.8.0
Changed
--load-limit Nadapts during the run instead of checking once at
startup. All-jworkers start; while the 1-minute load average from other
processes is aboveN, only one of them searches, and the rest wait between
archives. The load is rechecked every 5 s, and one job is added back per
check as it falls. trg's own workers are taken off the load before it is
compared, so a wide-jdoes not throttle itself. Output, ordering and
exit codes are unaffected.--load-limitnow works on macOS too. It was Linux-only.
targrep 0.7.2
Fixed
- zstd archives made with a long-distance window larger than 128 MB
(zstd --long=28up to--long=31) were refused with "Frame requires too
much memory for decoding", exit 2, so they could not be searched at all.
trg now accepts any window the format allows. Memory follows the data
actually decoded, not the declared window: a--long=31archive of 91 MB
peaked at 94 MB.
targrep 0.7.1
Fixed
- A zstd archive (or
.zstmember) that starts with a skippable frame — as
pzstdoutput does — was taken for plain text. Its compressed bytes were
searched as one binary file and the run exited 1, a claim of clean logs
about data that was never decompressed. Skippable frames
(0x184D2A50–0x184D2A5F) are now recognised as zstd.
targrep 0.7.0
Removed
- The whole-buffer inflate path (libdeflate) and the dependency on it. Since
0.6.1 it was only used when asked for, and it never used less total CPU than
zlib-ng streaming on any machine measured. trg always streams. --inflateand--inflate-budgetno longer do anything. They are still
accepted, and their values still checked (a typo is still exit 2), so
scripts that pass them keep working; each prints a deprecation note on
stderr. A later release will remove them.
Changed
-gglobs without a/also match the member's file name, as in ripgrep
and as--archive-globalready did:-g access.lognow finds
logs/access.log, where before it selected nothing. Matching the whole
member path still applies too, so no glob selects fewer members than before.
targrep 0.6.1
Changed
--inflate=auto, the default, now always streams. It used to decompress gzip
archives that inflate to under--inflate-budget(64 MB) whole into memory,
from a measurement that predates zlib-ng. Re-measured with
bench/inflate_modes.pyon x86-64, arm64 and Linux in a VM, that path never
used less total CPU, and on archives inflating to 42 MB it used 8–59% more
at 3.6× the memory.--inflate=bufferstill opts in.
Fixed
- A buffered inflate that cannot fit the budget is now refused before it
starts. The gzip trailer is a lower bound on the output, and when it already
exceeds--inflate-budgettrg used to decompress the whole archive anyway,
find it did not fit, and then stream it all again — twice the work for the
same answer.
targrep 0.6.0
Added
- GitHub releases carry prebuilt Linux binaries (x86_64 and aarch64, glibc
2.17 or newer) with SHA-256 checksums, built and smoke-tested by
.github/workflows/release.ymlon each tag. 0.5.0 was backfilled. - x86-64 benchmark figures in the README: 9.4× less CPU than
zgrep -a. - Exclusion globs, as in ripgrep: a leading
!excludes, for both-gand
--archive-glob(-g '!*.error.log',--archive-glob '!2026-09-*'). When
several globs match, the last one given wins. With at least one non-!
glob the list is a whitelist; with only!globs, everything else is
searched.
Changed
- A glob starting with
!used to be matched literally, so it matched
nothing; it now excludes. rust-version = "1.88"is declared (the floor set byglobsetand
ignore), so an older toolchain gets a clear error instead of a
dependency failure. CI checks it.
targrep 0.5.0
Added
--archive-glob PAT: when walking a directory, search only the archives
matchingPAT; repeatable, and an archive matching any of them is searched.
A glob without/matches the file name at any depth (2026-08-*.tgz); one
with/matches the path below the directory named (web1/*.tgz). Files
named on the command line are always searched, as withrg -g.- An
--archive-globthat matches no file anywhere in the walk is reported on
stderr and exits 2, so a typo can never read as clean logs.
Changed
- The project now has CI (tests and
clippy -D warningson Linux and macOS,
plus the--no-default-featuresbuild), and the scheduler ordering tests no
longer depend on timing.
targrep 0.4.0
Security
- Control bytes from logs and member names are no longer sent raw to a
terminal. A log line is attacker-controlled (a request URL, a User-Agent),
and its escape sequences could retitle the window, clear the screen, write
the clipboard, hide earlier text behind a carriage return, or on vulnerable
terminals type text back into the shell. On a tty they are now shown as
text:\x1b,\x07, a lone CR as\x0d, UTF-8 C1 controls as\u{9b}.
Tab, newline and CRLF line endings are kept. trg's own colours are
unaffected. --jsonoutput gets JSON's own escapes instead (\u007f,\u009b) for
the DEL and C1 bytes serde leaves raw, so it stays valid JSON either way.- Diagnostics on stderr are escaped the same way, decided separately by
whether stderr is a tty.
Added
--escape WHEN(auto|always|never, defaultauto):auto
escapes only on a tty, so piped and redirected output is byte-exact, as
before.
Changed
- Output on a terminal can differ from
rg's for lines with control bytes.
Piped output is unchanged.