#!/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