Sometimes unable to lock the index during pre-commit hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

I am the maintainer of https://github.com/Cosium/maven-git-code-format/.
maven-git-code-format is a code formatter plugin triggered by git
pre-commit hook.
On pre-commit, the plugin make use of https://www.eclipse.org/jgit/ to
alter the git index to format files.

When performing:
  git add . && git commit -m "Test"
The plugin works without issues

But when performing instead:
  git commit -am "Test"
The plugin fails because it can't lock the index file.

With the commit "all" command, it seems that the index is locked at
https://github.com/git/git/blob/master/builtin/commit.c#L419 and kept
locked during the pre commit hooks execution.

This difference of behaviour with or without "all" option leaves me puzzled.
Are pre-commit hooks expected to be able to manipulate the index?
If yes, can we call the current commit "all" behaviour a bug?
If no, is there a document specifying what hooks are authorized to do?

Thanks in advance



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux