Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328159

Summary: The OSEE project would like to add custom git-hooks to its git repository
Product: Community Reporter: Roberto Escobar <roberto.e.escobar>
Component: GitAssignee: Eclipse Webmaster <webmaster>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: nobody, ryan.d.brooks
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Roberto Escobar CLA 2010-10-19 12:55:16 EDT
Build Identifier: 

Committers are unable to write to the git hooks directory directly. For the OSEE project, we would like to setup a link to a shared area where commiters can modify git_hook scripts without disabling the update hook.


Reproducible: Always
Comment 1 Eclipse Webmaster CLA 2010-10-20 14:57:47 EDT
Access to the hooks directory is restricted(as you've noted) but if you can tell me what hooks you want to update(and why would be nice) we can discuss limited access.

-M.
Comment 2 Ryan Brooks CLA 2010-10-20 15:11:20 EDT
We wrote a hook that enforces our commit comment standard.  We also want to add one that requires the correct distribution statement at the top of Java files.  In fact, anything check we can think of that will improve the quality of commits.
Comment 3 Eclipse Webmaster CLA 2010-10-25 10:22:31 EDT
I've updated the permissions on the hooks directory to allow you to add your own(excluding the update hook).

-M.
Comment 4 Ryan Brooks CLA 2012-04-17 16:08:34 EDT
I am able to edit the existing sample files expected; however, I am not able to create the file pre-receive (or any other file) in the hooks directory.  I attempted this using WinSCP.

I also attempted using ssh from the command line and get the following:
   r$ cd
   Not allowed to do 'cd'
   Connection to git.eclipse.org closed.

I don't know if these two issues have different causes, but I'm not able to use git hooks currently because in order to make a hook take effect it has to have the proper name (I can't rename an existing sample file either).

Thanks,
Ryan
Comment 5 Denis Roy CLA 2012-04-18 09:24:17 EDT
Ryan, I've given your account a real shell for build.eclipse.org.  This will allow you to manipulate your Git repos as you'd like.  The Git repos are mounted on build.eclipse.org:/gitroot

You may need to close and re-open all your currently opened SSH connections.

I'll close this as 'fixed' -- please let me know if you need anything else.
Comment 6 Ryan Brooks CLA 2012-04-18 14:10:00 EDT
Denis,

Thanks for the real shell.  That fixed the problem with not being allowed to issue commands like cd.  However, I still have the other issue that stops file creation and prevents me from making a hook:

cp: cannot create regular file `pre-receive': Permission denied

and

touch: cannot touch `pre-receive': Permission denied
Comment 7 Denis Roy CLA 2012-04-18 14:15:31 EDT
Right... the hooks directory is owned by root to prevent tampering with the update hook.  I've changed that, so you should be all set.
Comment 8 Ryan Brooks CLA 2012-04-19 15:51:39 EDT
Worked perfectly. Thanks Denis.