summaryrefslogtreecommitdiff
path: root/pbs-package-commit
blob: 779d1e82a7814453d12447f8ae79c3e8dbf3ac77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash -euE

. pbs-plumb-shlib

cmd=${0##*/}
usage() {
	echo "Usage: $cmd [git-commit OPTIONS]"
	echo 'Commits changes to a package. (from pkg dir)'
	echo
	echo 'This is like `git commit`, but cascades up out of the submodule.'
	echo 'It is simply:'
	echo
	echo '    git commit "$@"'
	echo '    pbs-package-postcommit'
	echo
	echo 'Options:'
	echo '  -h            Show this message'
	echo
	echo ' ====================== `git commit` usage ======================'
	echo
	git commit -h 2>&1 || true
}

main() {
	if in_array '-h' "$@"; then
		usage
		return 0
	fi

	ensure_in_pbs-package
	git commit "$@"
	pbs-package-postcommit
}

main "$@"