Skip to content

Commit

Permalink
[EXP-001-REQ-de4c29b4] addressed
Browse files Browse the repository at this point in the history
; the Summary now shows whether one UID is part of the git history log
  • Loading branch information
Jan-Piotraschke committed Apr 19, 2024
1 parent 15e3564 commit 9ebbbb2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/summarize_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ echo "# Summary of Requirements" > SUMMARY.md
find . -name "requirements.md" | sort | while read file; do
directory=$(dirname "$file")
echo "## Requirements from $directory" >> SUMMARY.md
echo "" >> SUMMARY.md
echo "| Requirement ID | Present in Git History |" >> SUMMARY.md
echo "|----------------|------------------------|" >> SUMMARY.md
# Ensure that all lines, including those that might end without a newline, are read
while IFS= read -r line || [[ -n "$line" ]]; do
[[ -z "$line" ]] && continue # Skip empty lines
echo "- $line" >> SUMMARY.md
# Extract requirement ID and escape special characters for regex use in git log
req_id=$(echo "$line" | grep -o '\[.*\]')
# Check if the requirement ID is present in the git commit history
if git log --all --grep="$req_id" > /dev/null; then
echo "| $line | Yes |" >> SUMMARY.md
else
echo "| $line | No |" >> SUMMARY.md
fi
done < "$file"
echo "" >> SUMMARY.md
done
done

0 comments on commit 9ebbbb2

Please sign in to comment.