Tag Info

Hot answers tagged

20

While the hook is running, GIT_DIR and (if the worktree was defined explicitly) GIT_WORK_TREE are set. That means your pull won't run with the second repository in the directory you changed to. Try git --git-dir ~/websites/testing/.git --work-tree ~/websites/testing pull; or unset git's repo-local environment with this: unset $(git rev-parse ...


6

See :he :autocmd and :he BufWritePost The line would look like this: :autocmd BufWritePost /path/to/file/or/pattern !command <afile> If the <afile> thing does not work use %:p.


6

incron, based on inotify, implements just such a hook in a cron-like way. Unfortunately, it is Linux-specific, not generic to UNIX.


5

gitlab already uses the post-receive hook internally. you could fiddle around with that script and call your hook as well, but from the docs it looks like the "official" way would be to use "web-hooks", i.e. let gitlab call your webserver on post-receive and your webserver then pulls the repository. I haven't tried this myself, but since no one answered so ...


4

As requested, a bit of a tutorial on groups. Hopefully this isn't too elementary. By default, most user accounts are also part of a group of the same name. To determine what groups an account is a member of, use the groups command. # groups root root : root bin daemon sys adm disk wheel The first one listed is the primary group, and will be the default ...


4

You might find incron of interest if you're using Linux.


3

If you want to grant a user (such as git in your examples) access to another user's space, put them in the same group and set group rights accordingly. If you need more complex access control list functionality, you should look into POSIX ACLs as provided by getfacl(1) and setfacl(1).


3

The usual way to do something like that is CVS keyword expansion: http://cvsbook.red-bean.com/cvsbook.html#Using%20Keyword%20Expansion A small drawback is, that you'll have the $ signs in the file, but many people are used to this convention.


3

Gitlab doesn't have a post-receive hook since the developers replaced gitolite with gitlab-shell. Therefore you can: sudo -u git bash touch /home/git/repositories/<repository name>.git/hooks/post-receive vim /home/git/repositories/<repository name>.git/hooks/post-receive Make sure the git user has all the permissions needed to run the ...


3

Yup that is intended behavior. Your bounce doesn't pass check_recipient_access because smtpd directive and from your log, the bounce email never touch smtpd at all (bounce -> qmgr -> lmtp) One possible solution of your problem is using transport_maps instead of check_recipient_access. This directive was invoked by trivial-rewrite process and all email ...


2

I think the problem lies in the fact that you've set up a command in the authorized_keys file, but man sshd's section on the authorized_keys file format clearly states: command="command" Specifies that the command is executed whenever this key is used for authentication. The command supplied by the user (if any) is ignored. (…) This means that ...


2

Thanks everyone for your answers. I managed to get it working in the end with the help of this post by doing the following: 1. Using Separate Script Add this line to sudoers file (using visudo). gituser ALL=(web-user) NOPASSWD: /usr/local/sbin/startnode Contents of file /usr/local/sbin/startnode changed to following: #!/bin/bash cd ...


2

You can use hooks to accomplish this. It has been discussed on stackoverflow. http://stackoverflow.com/questions/7147699/limiting-file-size-in-git-repository


2

This is the default behavior of SVN when working with a certificate it does not trust. Take a look at the SSL Certificate Management section in "Version Control with Subversion". If the client receives a server certificate, it needs to verify that it trusts the certificate: is the server really who it claims to be? The OpenSSL library does this ...


2

Do I need to restart Apache No. SVN-hooks aren't Apache side of game, it's pure Subversion toys, thus - create and use immediately on svn-events


2

I have had problems with case sensitivity and subversion on windows before. Could that be the problem? I would try this: echo "%VISUALSVN_SERVER%\bin\VisualSVNServerHooks.exe" ^ commit-notification "%1" -r %2 ^ --from <from-email> --to <to-email> ^ --smtp-server <smtp-server> > <somepath>\text.txt Check that the command echoed ...


2

If you are writing to a file, you could just write to "|yourimportscript" and have it run off the piped input. When apache is restarted, it would restart the process. It would spend the majority of its time waiting until it received input and wouldn't require a cron job. You could write your script as a daemon and use famd to see if the file was modified. ...


2

Use svn update instead of svn checkout Make sure that you have Apache setup to ignore svn files


2

I don't believe there are any accessible hooks for new user creation in AD. You could do a script to poll for users, keep track of the existing ones, and then provision any new users. I think that's about as good as you're going to get. The other option is to provision your AD users with Python from your intranet side. Creating AD users is fairly easily ...


2

Short Answer: You can't get there from here. Longer Answer: There is no hook for "on account creation". You would have to wrap your user-creation into a script/process that also executes this python script after the account creation. Or, You can change your user-account-creation so that it is done from within a python script (or add those steps to your ...


1

The qemu message protocol (QMP) supports a number of asynchronous messages, including one about restart. If you start your qemu instance with a QMP Server it will report a restart. libvirtd uses QMP to manage qemu guests, so you might try setting something like a proxy qmp server up to look for reboot messages. http://wiki.qemu.org/QMP#Asynchronous_message ...


1

I got the "getting back to vim" part, but I'm not sure how to hit the ":w" command itself (which would be very handy, since that's quite reflexive for me) w | silent execute "! myscript" | redraw! I think it may be better for superuser as well.


1

This problem fixed in VisualSVN Server 2.1.3: Fixed: VisualSVNServerHooks.exe does not work if VisualSVN Server service account doesn't have access permissions to all parents of the repositories folder. See change log entry for VisualSVN Server 2.1.3 for more details.


1

If you're using http, know that HTTP does not support hooks and you could ssh:/


1

Make sure that the script file itself is actually executable. chmod ug+x .git/hooks/post-receive


1

You can do this using the "svnlook" command. Here's an example post-commit hook: #!/bin/sh REPOS="$1" REV="$2" /usr/bin/svnlook dirs-changed -r "$REV" "$REPOS" | egrep -q '^mywebsite' if [ $? -eq 0 ] ; then # publish site code fi You may need to run svnlook manually a few times to become familiar with the output and see how to set the match pattern ...


1

Doesn't this work? cd /home/smb/websites/testing env -i git pull Edited Better still cd /home/smb/websites/testing unset GIT_DIR git pull


1

I'd use incron. This uses the kernel's inotify hooks to run arbitrary commands on specified filesystem events.


1

I was able to accomplish this with ProFTPd & the mod_exec module.



Only top voted, non community-wiki answers of a minimum length are eligible