#!/bin/sh topdir=$(pwd) if [ "$#" -ne 1 ]; then echo "Usage: $0 " exit 1 fi action="$1" create_tag() { # XXX: should verify "git status" to ensure to uncommitted diffs repo manifest -r | cat } restore_tag() { while read line; do prj_entry=$(echo $line | grep " $tag" cd "$topdir/$dir" git checkout "$tag" done } case "$action" in create) create_tag ;; restore) restore_tag ;; *) usage ;; esac