pthbs

Packaging Through Hashed Build Scripts
git clone https://ccx.te2000.cz/git/pthbs
Log | Files | Refs | Submodules | README

gitdir_listrefs (443B)


      1 #!/bin/sh -e
      2 if test -n "$pthbs_xtrace"; then
      3 	set -x
      4 fi
      5 if test $# -ne 1; then
      6 	printf >&2 '%s: fatal: requires exactly one argument, got %s\n' "${0##*/}" $#
      7 	exit 2
      8 fi
      9 test -d "$1" || exit 2
     10 repo_dir=${1%/*}
     11 head=$( cd "$repo_dir" && git show -s --pretty=format:%H%n )
     12 printf '%s  %s\n' "$head" "$repo_dir"
     13 ( cd "$repo_dir" && git for-each-ref --format='%(objectname)' ) | while read commit; do
     14 	printf '%s  %s\n' "$commit" "$repo_dir"
     15 done