Commit with trailing white space

My patch in https://gerrit.collaboraoffice.com/c/online/+/5610/1 has got some trailing whitespace. I know, it is up to me, to be more careful. But I wonder how it could happen. I thought there was the .git-hooks/pre-commit to prevent such trailing whitespace.

The intent is that online.mirror/.git-hooks/pre-commit at 95df5ca357841782da696ba2ef436688f57e8e56 · CollaboraOnline/online.mirror · GitHub gives you a git hook in .git/hooks/pre-commit that calls into the engine/ git hook as well and prevents that, but that does not seem to work in your case in practice. Can you check if you have that git hook installed as .git/hooks/pre-commit? Thanks.

me and several colleagues had the problem that this commit hook was not set up at all, or it was pointing at a script that was downloaded from the gerrit server, which only adds a Change-Id and does not do various other things that our custom script does (edit: it was the `commit-msg` script in that case, but i guess it can happen for any hook).

if you want to be really sure that the git hooks in the online repo are set, run this:

scripts/refresh-git-hooks --force

1 Like

No, the folder had only .sample files.

Thanks, that works. Now the folder contains the files.

1 Like