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

set -euo pipefail

# This changes only a few times a year.
readonly stable_branch="apple/stable/20200714"
readonly stable_mnemonic="bastille"

# Remote for my fork.
readonly remote="jonas"

# Make sure we have upstream llvm as a remote.
git ls-remote --exit-code llvm > /dev/null
if ! git ls-remote --exit-code llvm > /dev/null; then
    git remote add llvm <EMAIL>:llvm/llvm-project.git
    git remote set-url --push llvm /dev/null
fi

git fetch -q --multiple origin llvm
git checkout -q origin/$stable_branch

for commit in "$@"
do
    git cherry-pick -x $commit
done

function join { local IFS='+'; echo "$*"; }

target_branch="🍒/$stable_mnemonic/$(join "$@")"

git push $remote "HEAD:refs/heads/$target_branch"<commit_msg>Use GitHub CLI to create the PR<commit_after>#!/usr/bin/env bash

set -euo pipefail

readonly repo="apple/llvm-project"

# This changes only a few times a year.
readonly stable_branch="apple/stable/20200714"
readonly stable_mnemonic="bastille"

# Make sure we have upstream llvm as a remote.
git ls-remote --exit-code llvm > /dev/null
if ! git ls-remote --exit-code llvm > /dev/null; then
    git remote add llvm <EMAIL>:llvm/llvm-project.git
    git remote set-url --push llvm /dev/null
fi

git fetch -q --multiple origin llvm
git checkout -q origin/$stable_branch

for commit in "$@"
do
    git cherry-pick -x $commit
done

function join { local IFS='+'; echo "$*"; }

target_branch="🍒/$stable_mnemonic/$(join "$@")"
git checkout -b "$target_branch"

# Use GitHub CLI to create a PR against the correct repo.
gh pr create --fill --base "$stable_branch"  --repo "$repo" --web
{'fraction_non_alphanumeric': 0.1288156288156288, 'fraction_numerical': 0.009768009768009768, 'mean_word_length': 3.7507246376811594, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3675668', 'n_tokens_mistral': 576, 'n_tokens_neox': 547, 'n_words': 191}