# pre-commit hook question

2 messages from 2014-06-14 to 2014-06-16. Participants: Nick Dimov, Junio C Hamano.
Thread: https://gitlist.dev/t/36914

## Nick Dimov, 2014-06-14 17:34

Subject: pre-commit hook question
Message-ID: <539C8796.3070709@gmail.com>
URL: https://gitlist.dev/e/539C8796.3070709%40gmail.com

```
Hello everyone.
Im struggling for a couple of hours to make git store metadata of the
files using metastore and I use hooks/pre-commit for this. The problem
is that the script is invoked correctly, and modifies the file
"metadata" but the file itself is not added into commit. I tried calling
"git add metadata" and "git add -u metadata" but there is no effect. The
file ends up uncommited and marked as modified or staged BUT not
commited, ever.

Is there any way to make this work?
Basically, I want it to update and commit the file "metadata" on each
commit.
(then i want to make the same on checkout, but first i need to make
storing work correctly)

Thanks!

P.S. If you are wondering why I need this, the answer is I store OS
files for an embedded device which needs permisions/suid flags etc.

```

## Junio C Hamano, 2014-06-16 18:23

Subject: Re: pre-commit hook question
Message-ID: <xmqqppi8r9x4.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqppi8r9x4.fsf%40gitster.dls.corp.google.com
In-Reply-To: <539C8796.3070709@gmail.com>

```
Nick Dimov <dimovnike@gmail.com> writes:

> Im struggling for a couple of hours to make git store metadata of the
> files using metastore and I use hooks/pre-commit for this.

The pre-commit hook is about checking if the commits being created
is sensible and rejecting otherwise, and it is not designed to allow
futzing what is recorded behind the user's back.

```
