Tomebert,

two thoughts:

1. why do you need to add the remote repeatedly. Surely you would set the 
mirror once whenyou setup the hook.

2. what/where is the lock file - what does it relate to? the ref being pushed, 
the config file, an object file, something on the remote?

Philip
  ----- Original Message ----- 
  From: tombert 
  To: Git for human beings 
  Sent: Sunday, December 18, 2016 12:27 AM
  Subject: [git-users] mirror repository from server hook


  Inside the server pre-receive hook I configure a new remote and push to it. 
Similar to this:


  git remote add test http://something.something/repo
  git push --mirror test


  From the bash command line all works, but when executed inside the hook I get:
  Unable to create <file.lock>: Permission denied


  I understand that the repository is already locked because of an ongoing push 
operation that triggers the hook.


  How do you suggest to proceed in this issue? The point is, even when I put 
the code outside the hook e.g. run it a minute later or so, I cannot guarantee 
that there will be no lock ongoing.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to