Created
June 9, 2022 21:13
-
-
Save nottrobin/4356719f2f7f4c6834bdebe5fa7bf327 to your computer and use it in GitHub Desktop.
Find latest commit, check for modified articles in it, check if it was added in this commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
commit_id=$(git log --format="%H" -n 1) | |
articles=( $(git diff --name-only HEAD HEAD^ | egrep '^_articles') ) | |
for article in "${articles[@]}" | |
do | |
article_added_in=$(git log --pretty=format:"%H" --diff-filter=A -- $article) | |
if [ "$commit_id" = "$article_added_in" ]; then | |
echo $article | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment