githooks

Deploy Haskell code that uses the Snap Framework

只谈情不闲聊 提交于 2019-12-22 12:18:29
问题 What's your experience with deploying Haskell code for production in Snap in a stable fashion? If the compilation fails on the server then I would like to abort the deployment and if it succeeds then I would like it to turn of the snap-server and start the new version instead. I know there are plenty of ways. Everything from rsync to git-hooks (git pull was a nightmare). But I would like to hear your experiences. 回答1: Where I work, we use Happstack and deploy on Ubuntu linux. We actually

remote: ImportError: No module named gitlab

本小妞迷上赌 提交于 2019-12-22 09:47:34
问题 I wrote gitlab hook with python. And added to post-receive hooks in gitlab server. When i push to remote origin server from my laptop, i get following error. But it works when i run script manually in gitlab server. How can i solve problem? Counting objects: 3, done. Writing objects: 100% (3/3), 240 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) remote: Traceback (most recent call last): remote: File "push.py", line 4, in <module> remote: import gitlab remote: ImportError: No

Multiple git hooks for the same trigger

时间秒杀一切 提交于 2019-12-22 08:05:45
问题 I have a post-checkout hook that I use locally in all of my repos (it renames my tmux session to repo-name/branch-name ) For a project I am working on, we just added a post-checkout hook that we're asking the whole team to use. I don't want to add my personal hook's logic to the team-wide hook, because it's not useful to everyone, but I also don't want to give it up. Is there a way to have more than one script execute on a single git-hook trigger? I want every git checkout to execute the

Git Hook Fails Silently

核能气质少年 提交于 2019-12-22 05:34:25
问题 I have a post-checkout and post-merge githook with these contents: #!/bin/bash # MIT © Sindre Sorhus - sindresorhus.com set -eux changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)" check_run() { echo "$changed_files" | grep --quiet "$1" && eval "$2" } echo '' echo 'running git submodule update --init --recursive if .gitmodules has changed' check_run .gitmodules "git submodule update --init --recursive" echo '' echo 'running npm install if package.json has changed'

Modify file before commit with pre-commit hook

感情迁移 提交于 2019-12-22 04:57:19
问题 I am trying to write a pre-commit hook that modify a line in my code but I do not know even from where to start. The problem is: I have a KEY public static final String APP_KEY = ""; //DELETE THE KEY BEFORE COMMIT!!! In order to avoid publishing the KEY to the repository I've think maybe git hooks are the thing we need instead of delete the key manually. I've take a look at Customizing git hooks but I do not know how to write the hook. Is there a way to before commit the changes, delete the

bypass pre-commit hook for merge commits

两盒软妹~` 提交于 2019-12-22 01:46:04
问题 I setup some git hooks to run some gulp commands on pre-commit. I basically run jshint / plato . I basically want to bypass these for two cases: hotfix branches (master / hotfix) git merge (or find a way to do it in a way that doesn't crash on the merge commit case) The plato gulp command runs analysis on the source and produces a /reports/ directory that tracks complexity over time. If we do this on the hotfix branch it will result in merge conflicts when merging them back into development.

Git push over SSH is not activating remote hooks

不问归期 提交于 2019-12-21 22:35:29
问题 I have the following problems that git push over SSH is not activating remote hooks . The server where Git repo is Linux ubuntu. Git version 1.7.9.5 My path to repo hooks /path/test.git/hooks/update ; with Update executable ( chmod +x ) In update file I put just simple check to be sure it works. #!/bin/sh echo "Hello World" echo "098" >> test.txt exit 1 I am connecting from Ubuntu (on Virtualbox) with following steps: touch somefile.txt git add -A git commit -ma "my somefile add Then: git

Git hook to detect file changes that contain a certain string

泪湿孤枕 提交于 2019-12-21 20:15:43
问题 I want to warn a user if their code includes a certain string and alert people via email. Right now I'm using a post-receive hook because the detection needs to be done on the server side. I am updating a server-side repository and running something like git diff-tree -r --name-only --no-commit-id $2 | xargs grep foo to detect bad string "foo." Problems with this approach: I don't like maintaining and entire working version of the repository server-side It scans the entire file, not just the

Wrong file permission when using git pull in a hook

你离开我真会死。 提交于 2019-12-21 16:54:00
问题 I have created the following git hook to update my web application when new changes are pushed to the repository #!/bin/sh #Update the server version to HEAD echo "Updating webapp..." unset $(git rev-parse --local-env-vars) (cd /var/www/webapp && git pull -q) However, if I add new files they get the wrong permissions. They are only readable by the owner and not by the group or by other users. But I need them to be readable by everyone. Locally they have the right permission bits. And even

Create global pre-commit hooks for entire team

六月ゝ 毕业季﹏ 提交于 2019-12-21 11:34:09
问题 How can I create a global pre-commit hook that is available for everyone in the team to use? Basically, I want that anytime someone clones the remote repository he should get this global pre-commit hook by default. I came across this change default git hooks, Git commit hooks - global settings and this https://coderwall.com/p/jp7d5q where it suggests to create a template directory having common hooks and set init.templatedir to point to this directory. However this is useful only for setting