[PATCH 1/2] Test core.packSizeLimit and document "bup on" bug

0 views
Skip to first unread message

Rob Browning

unread,
May 19, 2024, 2:00:47 PMMay 19
to bup-...@googlegroups.com
Signed-off-by: Rob Browning <r...@defaultvalue.org>
---

Proposed for 0.33.x and main.

Documentation/bup-config.5.md | 28 +++++++++++++++++++++++
note/0.33.x.md | 14 ++++++++++++
test/ext/test-packsizelimit | 42 ++++++++++++++++++++++++++++++++++-
3 files changed, 83 insertions(+), 1 deletion(-)
create mode 100644 Documentation/bup-config.5.md
create mode 100644 note/0.33.x.md

diff --git a/Documentation/bup-config.5.md b/Documentation/bup-config.5.md
new file mode 100644
index 000000000..c4b585069
--- /dev/null
+++ b/Documentation/bup-config.5.md
@@ -0,0 +1,28 @@
+% bup-config(5) Bup %BUP_VERSION%
+% Rob Browning <r...@defaultvalue.org>
+% %BUP_DATE%
+
+# NAME
+
+bup-config - bup configuration options
+
+# DESCRIPTION
+
+The following options may be set in the relevant `git` config
+(`git-config(1)`).
+
+# OPTIONS
+
+pack.packSizeLimit
+: Respected when writing pack files (e.g. via `bup save ...`).
+ Currently read from the repository to which the pack files are
+ being written, excepting `bup on REMOTE...` which incorrectly
+ reads the value from the `REMOTE` repository.
+
+# SEE ALSO
+
+`git-config`(1)
+
+# BUP
+
+Part of the `bup`(1) suite.
diff --git a/note/0.33.x.md b/note/0.33.x.md
new file mode 100644
index 000000000..5c71356db
--- /dev/null
+++ b/note/0.33.x.md
@@ -0,0 +1,14 @@
+Notable changes in main since 0.33.3 (incomplete)
+=================================================
+
+Bugs
+----
+
+* `bup-config(5)` has been added, and mentions that at the moment `bup
+ on REMOTE ...` incorrectly reads the `pack.packSizeLimit` from the
+ `REMOTE` repository.
+
+Thanks to (at least)
+====================
+
+...
diff --git a/test/ext/test-packsizelimit b/test/ext/test-packsizelimit
index f76e04596..3ccbd8016 100755
--- a/test/ext/test-packsizelimit
+++ b/test/ext/test-packsizelimit
@@ -13,13 +13,17 @@ bup() { "$top/bup" "$@"; }

WVPASS cd "$tmpdir"

-WVSTART 'pack size limit'
+
+WVSTART 'no pack size limit'

WVPASS bup init
WVPASSEQ $(WVPASS find "$BUP_DIR"/objects/pack -name "*.pack" | wc -l) 0
WVPASS bup random 50k | WVPASS bup split -n foo
WVPASSEQ 1 $(WVPASS find "$BUP_DIR"/objects/pack/*.pack | wc -l)

+
+WVSTART 'pack size limit'
+
rm -rf "$BUP_DIR"
WVPASS bup init
WVPASS git config pack.packSizeLimit 10k
@@ -27,4 +31,40 @@ WVPASSEQ $(WVPASS find "$BUP_DIR"/objects/pack -name "*.pack" | wc -l) 0
WVPASS bup random 50k | WVPASS bup split -n foo
WVPASS test $(WVPASS find "$BUP_DIR"/objects/pack/*.pack | wc -l) -gt 2

+
+bup_dir2="$tmpdir/bup2"
+
+
+WVSTART 'pack size limit (-r)'
+
+rm -rf "$BUP_DIR" "$bup_dir2"
+WVPASS bup init
+WVPASS bup -d "$bup_dir2" init
+
+# FIXME: This is wrong; destination repo should determine the limit.
+WVPASS git config pack.packSizeLimit 10k
+#WVPASS git --git-dir "$bup_dir2" config pack.packSizeLimit 10k
+
+WVPASSEQ $(WVPASS find "$BUP_DIR"/objects/pack -name "*.pack" | wc -l) 0
+WVPASSEQ $(WVPASS find "$bup_dir2"/objects/pack -name "*.pack" | wc -l) 0
+WVPASS bup random 50k | WVPASS bup split -r "$bup_dir2" -n foo
+WVPASSEQ $(WVPASS find "$BUP_DIR"/objects/pack -name "*.pack" | wc -l) 0
+WVPASS test $(WVPASS find "$bup_dir2"/objects/pack/*.pack | wc -l) -gt 2
+
+
+WVSTART 'pack size limit (on)'
+
+rm -rf "$BUP_DIR" "$bup_dir2"
+WVPASS bup init
+WVPASS bup -d "$bup_dir2" init
+WVPASS git --git-dir "$bup_dir2" config pack.packSizeLimit 10k
+WVPASSEQ $(WVPASS find "$BUP_DIR"/objects/pack -name "*.pack" | wc -l) 0
+WVPASSEQ $(WVPASS find "$bup_dir2"/objects/pack -name "*.pack" | wc -l) 0
+WVPASS bup random 50k > "$tmpdir/data"
+WVPASS bup -d "$bup_dir2" on - split -n foo "$tmpdir/data"
+WVPASS bup -d "$bup_dir2" join foo > "$tmpdir/data-joined"
+WVPASS cmp -b "$tmpdir/data" "$tmpdir/data-joined"
+WVPASSEQ $(WVPASS find "$BUP_DIR"/objects/pack -name "*.pack" | wc -l) 0
+WVPASS test $(WVPASS find "$bup_dir2"/objects/pack/*.pack | wc -l) -gt 2
+
WVPASS rm -r "$tmpdir"
--
2.43.0

Rob Browning

unread,
May 25, 2024, 3:26:04 PMMay 25
to bup-...@googlegroups.com
Rob Browning <r...@defaultvalue.org> writes:

> Signed-off-by: Rob Browning <r...@defaultvalue.org>
> ---
>
> Proposed for 0.33.x and main.

Pushed.

--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
Reply all
Reply to author
Forward
0 new messages