diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-03-19 17:19:42 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-03-19 17:19:42 -0400 |
commit | bb0b8efa06e504a5b82dbc0fb5f22721701dcb42 (patch) | |
tree | bf66edf6e1b91a5008f08b2b3c202a54ce2aa3e3 /pbs-package-postcommit | |
parent | 93cb6dddc415e481e52bdd5f0b379b7ea811dcf2 (diff) |
split pbs-package-commit into pbs-package-{post,}commit, and fix it
Diffstat (limited to 'pbs-package-postcommit')
-rwxr-xr-x | pbs-package-postcommit | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/pbs-package-postcommit b/pbs-package-postcommit new file mode 100755 index 0000000..e8ff196 --- /dev/null +++ b/pbs-package-postcommit @@ -0,0 +1,35 @@ +#!/bin/bash -euE + +. pbs-plumb-shlib + +cmd=${0##*/} +usage() { + echo "Usage: $cmd [git-commit OPTIONS]" + echo 'Call this after doing a `git commit` manually.' + echo '' + echo 'This cascades the commit up out of the submodule.' + echo '' + echo 'Options:' + echo ' -h Show this message' +} + +main() { + if in_array '-h' "$@"; then + usage + return 0 + fi + + ensure_in_pbs-package + + # push the commit upstream + git push -f origin "$(gitbranch)" + + # update the submodule + local msg="$(git log -n1 --pretty=format:%B)" + local dir="$(pwd)" + cdto_pbs-root + git add "$dir" + git commit -m "$msg" +} + +main "$@" |