Update uncrustify hook to make the commands more copy & pastable (again)
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/d78514e1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/d78514e1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/d78514e1 Branch: refs/heads/master Commit: d78514e1594027733a23f3b19960e24212c42a07 Parents: a07ed8d Author: Andrew Grieve <agri...@chromium.org> Authored: Wed Oct 3 13:49:44 2012 -0400 Committer: Andrew Grieve <agri...@chromium.org> Committed: Wed Oct 3 13:49:44 2012 -0400 ---------------------------------------------------------------------- hooks/pre-commit | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/d78514e1/hooks/pre-commit ---------------------------------------------------------------------- diff --git a/hooks/pre-commit b/hooks/pre-commit index 0558e1e..7a420c9 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -23,18 +23,18 @@ exec 1>&2 RET=0 files=$(bin/uncrustify.sh --filter $(git diff --cached --name-only)) +MSGS= for file in $files; do if ! bin/uncrustify.sh --check-file $file; then - echo "Style fix-ups required: $file. Please run:" - echo " bin/uncrustify.sh \"$file\" && git add \"$file\"" + MSGS="$MSGS + bin/uncrustify.sh \"$file\" && git add \"$file\"" RET=1 fi done if [[ $RET = 1 ]]; then - echo - echo "Commit aborted!" - echo "Run the commands above to fix your files before committing." + echo "Commit aborted because style fix-ups are required." + echo "Please run:$MSGS" echo "Alternatively, run \"$PWD/bin/uncrustify.sh --staged\" and then re-stage affected files." fi