diff options
Diffstat (limited to 'comp2041/tigger/tigger-log')
| -rwxr-xr-x | comp2041/tigger/tigger-log | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/comp2041/tigger/tigger-log b/comp2041/tigger/tigger-log new file mode 100755 index 0000000..5e269c2 --- /dev/null +++ b/comp2041/tigger/tigger-log @@ -0,0 +1,24 @@ +#!/bin/dash + +# Test if we have a valid repo before doing anything. +if ! [ -d ".tigger/" ]; then + printf "tigger-add: error: tigger repository directory .tigger not found\n" >&2 + exit 1 +fi + +# Get current branch. +branch=$(cat .tigger/branch.tig) +mkdir --parents ".tigger/$branch/" + +# Iterate through commits and print their message. +for commit in $(find .tigger/"$branch"/* -maxdepth 0 -type d | grep -o -E "[\/][^\/]*$" | tr -d "/" | sort -r -n); do + + # No message = we're working on it, so it's not considered here. + if ! [ -e .tigger/"$branch"/"$commit"/message.tig ]; then + continue + fi + + printf "%s %s\n" "$commit" "$(cat .tigger/"$branch"/"$commit"/message.tig)" +done + +exit 0 |
