Skip to content

Releases: codedeviate/trg

targrep 0.10.0

Choose a tag to compare

@github-actions github-actions released this 26 Oct 07:31

Added

  • .zip archives, through the stuffr-formats crate'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.gz in 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 .Z member inside an archive is reported unread (exit 2)
    rather than searched as binary.
    • .Z records neither its length nor a checksum, so a truncated one reads
      as a shorter file with no error. A .Z with 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 print trg: tar entry: unexpected end of file and
    leave you to find it. Every such diagnostic now starts with the archive's
    path.

targrep 0.9.0

Choose a tag to compare

@github-actions github-actions released this 25 Oct 15:32

Added

  • bzip2 and lz4, detected from content like the other formats: .tar.bz2,
    .tar.lz4, bare .bz2 and .lz4 logs, and .bz2 or .lz4 members 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 -l format, and steps over a leading skippable frame. A skippable
      frame between two data frames is reported as an error (exit 2).

targrep 0.8.0

Choose a tag to compare

@github-actions github-actions released this 25 Oct 09:54

Changed

  • --load-limit N adapts during the run instead of checking once at
    startup. All -j workers start; while the 1-minute load average from other
    processes is above N, 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 -j does not throttle itself. Output, ordering and
    exit codes are unaffected.
  • --load-limit now works on macOS too. It was Linux-only.

targrep 0.7.2

Choose a tag to compare

@github-actions github-actions released this 24 Oct 16:05

Fixed

  • zstd archives made with a long-distance window larger than 128 MB
    (zstd --long=28 up 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=31 archive of 91 MB
    peaked at 94 MB.

targrep 0.7.1

Choose a tag to compare

@github-actions github-actions released this 24 Oct 15:17

Fixed

  • A zstd archive (or .zst member) that starts with a skippable frame — as
    pzstd output 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

Choose a tag to compare

@github-actions github-actions released this 23 Oct 19:59

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.
  • --inflate and --inflate-budget no 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

  • -g globs without a / also match the member's file name, as in ripgrep
    and as --archive-glob already did: -g access.log now 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

Choose a tag to compare

@github-actions github-actions released this 23 Oct 19:39

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.py on 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=buffer still 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-budget trg 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

Choose a tag to compare

@github-actions github-actions released this 23 Oct 17:14

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.yml on 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 -g and
    --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 by globset and
    ignore), so an older toolchain gets a clear error instead of a
    dependency failure. CI checks it.

targrep 0.5.0

Choose a tag to compare

@codedeviate codedeviate released this 23 Oct 16:21

Added

  • --archive-glob PAT: when walking a directory, search only the archives
    matching PAT; 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 with rg -g.
  • An --archive-glob that 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 warnings on Linux and macOS,
    plus the --no-default-features build), and the scheduler ordering tests no
    longer depend on timing.

targrep 0.4.0

Choose a tag to compare

@codedeviate codedeviate released this 23 Oct 11:12

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.
  • --json output 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, default auto): 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.