<commit_before>#!/usr/bin/env bash
. ./wvtest-bup.sh

top="$(WVPASS pwd)" || exit $?
tmpdir="$(WVPASS wvmktempdir)" || exit $?

export BUP_DIR="$tmpdir/bup"
export GIT_DIR="$tmpdir/bup"

bup() { "$top/bup" "$@"; }

WVPASS bup init
WVPASS cd "$tmpdir"

WVSTART "cat-file"
WVPASS mkdir src
WVPASS date > src/foo
WVPASS bup index src
WVPASS bup save -n src src
WVPASS bup cat-file "src/latest/$(pwd)/src/foo" > cat-foo
WVPASS diff -u src/foo cat-foo

WVSTART "cat-file --meta"
WVPASS bup meta --create --no-paths src/foo > src-foo.meta
WVPASS bup cat-file --meta "src/latest/$(pwd)/src/foo" > cat-foo.meta

WVPASS bup meta -tvvf src-foo.meta | WVPASS grep -vE '^atime: ' > src-foo.list
WVPASS bup meta -tvvf cat-foo.meta | WVPASS grep -vE '^atime: ' > cat-foo.list
WVPASS diff -u src-foo.list cat-foo.list

WVSTART "cat-file --bupm"
WVPASS bup cat-file --bupm "src/latest/$(pwd)/src/" > bup-cat-bupm
src_hash=$(WVPASS bup ls -s "src/latest/$(pwd)" | cut -d' ' -f 1) || exit $?
bupm_hash=$(WVPASS git ls-tree "$src_hash" | grep -F .bupm | cut -d' ' -f 3) \
    || exit $?
bupm_hash=$(WVPASS echo "$bupm_hash" | cut -d'	' -f 1) || exit $?
WVPASS git cat-file blob "$bupm_hash" > git-cat-bupm
WVPASS cmp -b git-cat-bupm bup-cat-bupm

WVPASS rm -rf "$tmpdir"<commit_msg>test-cat-file.sh: use -l instead of -b; explain differences.<commit_after>#!/usr/bin/env bash
. ./wvtest-bup.sh

top="$(WVPASS pwd)" || exit $?
tmpdir="$(WVPASS wvmktempdir)" || exit $?

export BUP_DIR="$tmpdir/bup"
export GIT_DIR="$tmpdir/bup"

bup() { "$top/bup" "$@"; }

WVPASS bup init
WVPASS cd "$tmpdir"

WVSTART "cat-file"
WVPASS mkdir src
WVPASS date > src/foo
WVPASS bup index src
WVPASS bup save -n src src
WVPASS bup cat-file "src/latest/$(pwd)/src/foo" > cat-foo
WVPASS diff -u src/foo cat-foo

WVSTART "cat-file --meta"
WVPASS bup meta --create --no-paths src/foo > src-foo.meta
WVPASS bup cat-file --meta "src/latest/$(pwd)/src/foo" > cat-foo.meta

WVPASS bup meta -tvvf src-foo.meta | WVPASS grep -vE '^atime: ' > src-foo.list
WVPASS bup meta -tvvf cat-foo.meta | WVPASS grep -vE '^atime: ' > cat-foo.list
WVPASS diff -u src-foo.list cat-foo.list

WVSTART "cat-file --bupm"
WVPASS bup cat-file --bupm "src/latest/$(pwd)/src/" > bup-cat-bupm
src_hash=$(WVPASS bup ls -s "src/latest/$(pwd)" | cut -d' ' -f 1) || exit $?
bupm_hash=$(WVPASS git ls-tree "$src_hash" | grep -F .bupm | cut -d' ' -f 3) \
    || exit $?
bupm_hash=$(WVPASS echo "$bupm_hash" | cut -d'	' -f 1) || exit $?
WVPASS git cat-file blob "$bupm_hash" > git-cat-bupm
if ! cmp git-cat-bupm bup-cat-bupm; then
    cmp -l git-cat-bupm bup-cat-bupm
    diff -uN <(bup meta -tvvf git-cat-bupm) <(bup meta -tvvf bup-cat-bupm)
    WVPASS cmp git-cat-bupm bup-cat-bupm
fi

WVPASS rm -rf "$tmpdir"
{'fraction_non_alphanumeric': 0.1813186813186813, 'fraction_numerical': 0.002197802197802198, 'mean_word_length': 3.34181240063593, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3697862', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1239, 'n_words': 313}