Stream: Coq devs & plugin devs

Topic: commit hook


view this post on Zulip Gaëtan Gilbert (Nov 19 2020 at 10:12):

@Pierre-Marie Pédrot https://github.com/coq/coq/pull/13405#issuecomment-730037174

The git hook that checks for newlines seems to be unhappy with binary files and potentially messing with them.

What does git check-attr whitespace -- test-suite/.csdp.cache.test-suite say for you?
should be test-suite/.csdp.cache.test-suite: whitespace: unset

view this post on Zulip Pierre-Marie Pédrot (Nov 19 2020 at 10:22):

This seems fine, but it might be because I had to go through the untracked, auto-generated .csdp.cache file

view this post on Zulip Gaëtan Gilbert (Nov 19 2020 at 10:23):

check-eof-newline should only touch tracked files though

view this post on Zulip Pierre-Marie Pédrot (Nov 19 2020 at 10:23):

I think I did something along the lines of rm .csdp.cache.test-suite; touch .csdp.cache.test-suite; make test-suite; cp .csdp.cache .csdp.cache.test-suite

view this post on Zulip Gaëtan Gilbert (Nov 19 2020 at 10:24):

did the hook say anything?

view this post on Zulip Pierre-Marie Pédrot (Nov 19 2020 at 10:24):

then I wanted to amend a previous commit that had generated a corrupted binary file

view this post on Zulip Pierre-Marie Pédrot (Nov 19 2020 at 10:24):

and the hook complained about newline errors in the file

view this post on Zulip Pierre-Marie Pédrot (Nov 19 2020 at 10:24):

actually commit --amend plainly failed

view this post on Zulip Pierre-Marie Pédrot (Nov 19 2020 at 10:25):

I had to commit --amend -n

view this post on Zulip Pierre-Marie Pédrot (Nov 19 2020 at 10:25):

So I suspect that the file that was generated before had been corrupted by git somehow

view this post on Zulip Théo Zimmermann (Nov 19 2020 at 11:25):

I also remember having had to bypass the commit hook when updating a png file in the repo.


Last updated: Oct 16 2021 at 02:03 UTC