digint / digint/btrbk

`stream_compress_long default` doesn't add `--long` to command line

Open
#615 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Perl
Stars
2.1k
Forks
139
PR merge metrics
No merged PRs in 30d

Description

My config:
```
stream_compress zstd
stream_compress_level default
stream_compress_threads 0 # zstd will detect physical CPU cores
stream_compress_long default
stream_compress_adapt yes
```

I don't see `--long` in the output:
```
### (dryrun) btrfs send -p '/media/ssd/btrbk/rootfs/rootfs.20250406T1553' '/media/ssd/btrbk/rootfs/rootfs.20250410T0800' | mbuffer -v 1 -m 2
56m | zstd -c -T0 --adapt | ssh -i '/root/.ssh/id_ed25519_nas_btrbk' -o compression=no root@nas 'zstd -d -c -T0 --adapt | mbuffer -v 1 -q -m
256m | btrfs receive '\''/btrbk/svelte/rootfs/'\'''
```

The man page says:
```
stream_compress_long default|
Enable long distance matching for the specified .
Refer to the related man-page for details. Only supported for "zstd".
```

zstd man page says:
```
○ --long[=#]: enables long distance matching with # windowLog, if #
is not present it defaults to 27. This increases the window size
(windowLog) and memory usage for both the compressor and decom‐
pressor. This setting is designed to improve the compression ratio
for files with long matches at a large distance.
```

I would expect to see `--long` with `default` and `--long=` with a number specified.

## Work-around
```
stream_compress_long 27 # Work-around: explicitly set zstd's default == 2^27 == 128MB
```

## Suggestion
Allow `default` can actually use `zstd`'s default with `--long` with no argument.

Add `no`, or alternatively `yes`:
```
stream_compress_long no|default|
stream_compress_long yes|default|
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.