Skip to content

Instantly share code, notes, and snippets.

@4383

4383/check.sh Secret

Last active October 21, 2020 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4383/511359cc2080e06295944c5f40bd1033 to your computer and use it in GitHub Desktop.
Save 4383/511359cc2080e06295944c5f40bd1033 to your computer and use it in GitHub Desktop.
Identify potential changes to analyze between October 1 2020 and October 20 2020
#!/bin/bash
git fetch origin
# Retrieve all merged changes between October 1st and October 20
for commit in $(git log --since "OCT 1 2020" --until "OCT 20 2020" --pretty=format:"%H" --no-merges origin/master)
do
# Retrieve modified files
modified_files=$(git log -m -1 --max-parents=1 --pretty="format:" --name-only ${commit})
identified_files=""
for file in ${modified_files}
do
# Ignore releases and documentations changes, in other words only extract code changes
if [[ "${file}" != deliverables/*.yaml ]] && \
[[ "${file}" != doc/*.rst ]] && \
[[ "${file}" != data/*.yaml ]]; then
identified_files="${identified_files}\t- ${file}"
fi
if [ ! -z "${identified_files}" ]; then
echo -e "Commit to analyze:"
echo "https://review.opendev.org/#/q/${commit}"
echo "Files to analyze:"
echo -e "${identified_files}"
echo "-------------------------------"
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment