<commit_before>#!/usr/bin/env bash

set -e

LAST_RELEASE_TAG="$(git describe --tags --abbrev=0)"
LAST_RELEASE_TIMESTAMP="$(git log --format="%ct" -1 "${LAST_RELEASE_TAG}")"
echo "Last release: ${LAST_RELEASE_TAG} at ${LAST_RELEASE_TIMESTAMP}"

REPOS=(
    .
    cookbook
)

for package in $(installer/target/release/redox_installer --list-packages -c config/x86_64/desktop.toml)
do
    REPOS+=("cookbook/recipes/${package}/source")
done

# TODO: resolve dependencies instead of manually adding these initfs packages
for package in init logd nulld ramfs randd zerod
do
    REPOS+=("cookbook/recipes/${package}/source")
done

for repo in "${REPOS[@]}"
do
    remote="$(git -C "${repo}" remote get-url origin)"
    website="${remote%.*}"
    name="$(basename "${website}")"
    before="$(git -C "${repo}" log --until="${LAST_RELEASE_TIMESTAMP}" --format="%h" -1)"
    after="$(git -C "${repo}" log --since="${LAST_RELEASE_TIMESTAMP}" --format="%h" -1)"
    echo -en "\x1B[1m${name}:\x1B[0m "
    if [ -z "${before}" ]
    then
        echo "New repository at ${website}"
    elif [ -z "${after}" ]
    then
        echo "No changes"
    else
        echo "${website}/-/compare/${before}...${after}"
    fi
done
<commit_msg>Changelog script improvements<commit_after>#!/usr/bin/env bash

set -e

LAST_RELEASE_TAG="$(git describe --tags --abbrev=0)"
LAST_RELEASE_TIMESTAMP="$(git log --format="%ct" -1 "${LAST_RELEASE_TAG}")"
echo "Last release: ${LAST_RELEASE_TAG} at ${LAST_RELEASE_TIMESTAMP}"

REPOS=(
    redox=.
    cookbook=cookbook
)

for package in $(installer/target/release/redox_installer --list-packages -c config/x86_64/desktop.toml)
do
    REPOS+=("${package}=cookbook/recipes/${package}/source")
done

# TODO: resolve dependencies instead of manually adding these initfs packages
for package in init logd nulld ramfs randd zerod
do
    REPOS+=("${package}=cookbook/recipes/${package}/source")
done

for name_repo in "${REPOS[@]}"
do
    name="$(echo "${name_repo}" | cut -d "=" -f 1)"
    repo="$(echo "${name_repo}" | cut -d "=" -f 2-)"
    echo -en "\x1B[1m${name}:\x1B[0m "
    if [ -e "${repo}/.git" ]
    then
        remote="$(git -C "${repo}" remote get-url origin)"
        website="${remote%.*}"
        before="$(git -C "${repo}" log --until="${LAST_RELEASE_TIMESTAMP}" --format="%h" -1)"
        after="$(git -C "${repo}" log --since="${LAST_RELEASE_TIMESTAMP}" --format="%h" -1)"
        if [ -z "${before}" ]
        then
            echo "New repository at ${website}"
        elif [ -z "${after}" ]
        then
            echo "No changes"
        else
            echo "${website}/-/compare/${before}...${after}"
        fi
    else
        echo "Not a git repository"
    fi
done

{'fraction_non_alphanumeric': 0.19195275009228496, 'fraction_numerical': 0.009597637504614249, 'mean_word_length': 3.221183800623053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2913351', 'n_tokens_mistral': 949, 'n_tokens_neox': 908, 'n_words': 234}