diff options
author | Colin Kinloch <colin.kinloch@collabora.com> | 2022-12-01 18:45:59 +0000 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2022-12-02 17:53:34 +0000 |
commit | 39f15af0386290911ebeda84d59c6fe4c149156e (patch) | |
tree | 91599844b42088c94012dfd0542c4c3513038bc8 /scripts | |
parent | 36c3bb0d050dd9e7b63c79fada0b0b0532b2b206 (diff) | |
download | gstreamer-39f15af0386290911ebeda84d59c6fe4c149156e.tar.gz |
git: Show all suggestions on pre-commit hook
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3506>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/git-hooks/pre-commit.hook | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/scripts/git-hooks/pre-commit.hook b/scripts/git-hooks/pre-commit.hook index 1224ffd3d9..3b9b5c3708 100755 --- a/scripts/git-hooks/pre-commit.hook +++ b/scripts/git-hooks/pre-commit.hook @@ -68,18 +68,28 @@ for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep " rm "${newfile}" rm "${nf}" if [ $r != 0 ] ; then + ERROR_FILES="$ERROR_FILES $file" echo "=================================================================================================" echo " Code style error in: $file " +echo "=================================================================================================" +echo "" + fi +done + +if [ -n "$ERROR_FILES" ];then +echo "=================================================================================================" +echo " Code style error in: " +for file in $ERROR_FILES ; do +echo " $file" +done echo " " echo " Please fix before committing. Don't forget to run git add before trying to commit again. " echo " If the whole file is to be committed, this should work (run from the top-level directory): " -echo " " -echo " gst-indent $file; git add $file; git commit" +echo " scripts/gst-indent$ERROR_FILES ; git add$ERROR_FILES ; git commit" echo " " echo "=================================================================================================" - exit 1 - fi -done + exit 1 +fi csharp_files=` git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "^subprojects/gstreamer-sharp/.*cs$" ` if test "x$csharp_files" != "x"; then |