repack: a minor mod on git-repack to allow pruning of grafted-over history
[puppet-git.git] / ppg
blobd112d72a45d7d0c036a2c75c75abe4f0767bb6ba
1 #!/bin/bash
3 usage() {
4 echo "Usage: ppg COMMAND [OPTIONS] [TARGET]"
5 echo
6 echo "ppg commands are:"
8 cat <<\EOF | sed -e 's/^/ /'
10 For development environments
12 init-devenv Prepares a development/test environment for commits
13 commit Commits though to git
14 schedule Schedule a commit for merge to production
16 For puppet clients
18 clone Clones and inits a client environment
19 init Prepares a client environment after a "git clone"
20 pullapply Updates and applies config updates
21 apply Apply changes manually
23 EOF
26 PPG_EXEC_PATH=$( dirname $(realpath "${BASH_SOURCE[0]}" ) )
28 cmd=
29 case "$#" in
30 0) usage
32 *) cmd="$1"
33 shift
34 case "$cmd" in
35 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
36 echo "ppg version @@PPG_VERSION@@"
37 exit 0 ;;
38 -h|--help)
39 usage
40 exit 0;;
41 -*)
42 echo >&2 "ERROR: Unknown option $cmd"
43 usage
44 exit 1;
45 esac
47 if [[ -x "$PPG_EXEC_PATH/ppg-$cmd" ]]; then
48 exec "$PPG_EXEC_PATH/ppg-$cmd" "$@"
49 exit $?
50 else
51 echo >&2 "ERROR: Unknown command $cmd"
52 usage
53 exit 1;
56 esac