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

function help() {
  echo "Usage: $0 [-h|<sha>]"
  echo
  echo "  -h  display this help"
  echo "  With no arguments, prompts for the last release sha"
  echo
  echo "Attempts to generate a mostly complete changelog .rst section"
  echo "given the last release sha.  Each commit since that sha will"
  echo "have an RST compatible bullet generated with commit summary"
  echo "and ISSUE/RB links if present in the commit message.  A"
  echo "header not intended for the changelog is included to provide"
  echo "information about the commit in case more investigation is"
  echo "needed."
  if (( $# > 0 ))
  then
    echo
    echo "$@"
    exit 1
  else
    exit
  fi
}

if (( $# > 1 ))
then
  help "Too many arguments."
elif (( $# == 0 ))
then
 read -rp "What git commit hash or tag was the last release made from?: " LAST_RELEASE_IDENTIFIER
elif [[ "$1" == "-h" ]]
then
  help
else
  LAST_RELEASE_IDENTIFIER="$1"
fi

echo
echo "Potentially relevant headers:"
echo "----------------------------------------------------------------------------------------------------"
cat <<EOF

API Changes
~~~~~~~~~~~


New Features
~~~~~~~~~~~~


Bugfixes
~~~~~~~~


Refactoring, Improvements, and Tooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Testing
~~~~~~~


Documentation
~~~~~~~~~~~~~


EOF

echo
echo "Changes since ${LAST_RELEASE_IDENTIFIER}:"
echo "----------------------------------------------------------------------------------------------------"
echo

for sha in $(git log --format="format:%H" HEAD "^${LAST_RELEASE_IDENTIFIER}")
do
  subject=$(git log -1 --format="format:%s" "$sha")
  echo "* ${subject}"
<commit_msg>Differentiate between User API vs. Plugin API changes in changelog (#10916)<commit_after>#!/usr/bin/env bash

function help() {
  echo "Usage: $0 [-h|<sha>]"
  echo
  echo "  -h  display this help"
  echo "  With no arguments, prompts for the last release sha"
  echo
  echo "Attempts to generate a mostly complete changelog .rst section"
  echo "given the last release sha.  Each commit since that sha will"
  echo "have an RST compatible bullet generated with commit summary"
  echo "and ISSUE/RB links if present in the commit message.  A"
  echo "header not intended for the changelog is included to provide"
  echo "information about the commit in case more investigation is"
  echo "needed."
  if (( $# > 0 ))
  then
    echo
    echo "$@"
    exit 1
  else
    exit
  fi
}

if (( $# > 1 ))
then
  help "Too many arguments."
elif (( $# == 0 ))
then
 read -rp "What git commit hash or tag was the last release made from?: " LAST_RELEASE_IDENTIFIER
elif [[ "$1" == "-h" ]]
then
  help
else
  LAST_RELEASE_IDENTIFIER="$1"
fi

echo
echo "Headers. Delete any that are unused."
echo "We do not include internal-only changes. However, in the release prep PR, it's helpful to put" \
     "these internal-only changes in a comment so that other reviewers can check if any should be added" \
     "back to the changelog."
echo "----------------------------------------------------------------------------------------------------"
cat <<EOF

User API Changes
~~~~~~~~~~~~~~~~


Plugin API Changes
~~~~~~~~~~~~~~~~~~


New Features
~~~~~~~~~~~~


Bugfixes
~~~~~~~~


Documentation
~~~~~~~~~~~~~


EOF

echo
echo "Changes since ${LAST_RELEASE_IDENTIFIER}:"
echo "----------------------------------------------------------------------------------------------------"
echo

for sha in $(git log --format="format:%H" HEAD "^${LAST_RELEASE_IDENTIFIER}")
do
  subject=$(git log -1 --format="format:%s" "$sha")
  echo "* ${subject}"

{'fraction_non_alphanumeric': 0.24489795918367346, 'fraction_numerical': 0.005870841487279843, 'mean_word_length': 2.303785780240074, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3097597', 'n_tokens_mistral': 1050, 'n_tokens_neox': 974, 'n_words': 404}