# Commit with trailing white space

**URL:** <https://forum.collaboraonline.com/t/commit-with-trailing-white-space/4823>\
**Category:** Development\
**Created:** [July 7, 2026, 1:58pm UTC](https://forum.collaboraonline.com/t/commit-with-trailing-white-space/4823 "2026-07-07T13:58:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Regina](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Regina](https://forum.collaboraonline.com/u/Regina)\
**Post date:** [July 7, 2026, 1:58pm UTC](https://forum.collaboraonline.com/t/commit-with-trailing-white-space/4823/1 "2026-07-07T13:58:32Z")

</div>

My patch in [https://gerrit.collaboraoffice.com/c/online/+/5610/1](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.

---

<div class="post-metadata">

**Author:** ![vmiklos](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/vmiklos/32/787_2.png) [@vmiklos](https://forum.collaboraonline.com/u/vmiklos)\
**Post date:** [July 7, 2026, 3:12pm UTC](https://forum.collaboraonline.com/t/commit-with-trailing-white-space/4823/2 "2026-07-07T15:12:09Z")

</div>

The intent is that [online.mirror/.git-hooks/pre-commit at 95df5ca357841782da696ba2ef436688f57e8e56 · CollaboraOnline/online.mirror · GitHub](https://github.com/collaboraonline/online.mirror/blob/95df5ca357841782da696ba2ef436688f57e8e56/.git-hooks/pre-commit#L180-L182) 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.

---

<div class="post-metadata">

**Author:** ![mst](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@mst](https://forum.collaboraonline.com/u/mst)\
**Post date:** [July 7, 2026, 4:22pm UTC](https://forum.collaboraonline.com/t/commit-with-trailing-white-space/4823/3 "2026-07-07T16:22:09Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![Regina](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@Regina](https://forum.collaboraonline.com/u/Regina)\
**Post date:** [July 7, 2026, 4:35pm UTC](https://forum.collaboraonline.com/t/commit-with-trailing-white-space/4823/4 "2026-07-07T16:35:50Z")

</div>

> [@vmiklos](#):
>
> Can you check if you have that git hook installed as .git/hooks/pre-commit?

No, the folder had only `.sample` files.

> [@mst](#):
>
> if you want to be really sure that the git hooks in the `online` repo are set, run this:
> 
> `scripts/refresh-git-hooks --force`

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