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