githooks,atlassian-stash , local atlassian stash server error debugging plugin

local atlassian stash server error debugging plugin


Tag: githooks,atlassian-stash

Im trying to setup a dev environment to create a git hook plugin for Atlassian stash server. When I run atlas-debug to start the web server then browse to localhost:port The Stash home page doesn't display and I get this error in the console...

[INFO] [talledLocalContainer] 2015-03-10 21:09:51,279 WARN  [threadpool:thread-15]  c.a.s.i.s.g.t.DefaultTranscodeServer GET /stash HTTP/1.1
[INFO] [talledLocalContainer] Host: localhost:52883
[INFO] [talledLocalContainer] Connection: keep-alive
[INFO] [talledLocalContainer] Pragma: no-cache
[INFO] [talledLocalContainer] Cache-Control: no-cache
[INFO] [talledLocalContainer] Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
[INFO] [talledLocalContainer] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36
[INFO] [talledLocalContainer] Accept-Encoding: gzip, deflate, sdch
[INFO] [talledLocalContainer] Accept-Language: en-US,en;q=0.8
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer]  could not be transcoded; ignoring request
[INFO] [talledLocalContainer] java.lang.IllegalArgumentException: The specified path, GET /stash HTTP/1.1
[INFO] [talledLocalContainer] Host: localhost:52883
[INFO] [talledLocalContainer] Connection: keep-alive
[INFO] [talledLocalContainer] Pragma: no-cache
[INFO] [talledLocalContainer] Cache-Control: no-cache
[INFO] [talledLocalContainer] Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
[INFO] [talledLocalContainer] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36
[INFO] [talledLocalContainer] Accept-Encoding: gzip, deflate, sdch
[INFO] [talledLocalContainer] Accept-Language: en-US,en;q=0.8
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] , does not belong to Stash and cannot be transcoded.
[INFO] [talledLocalContainer]   at com.atlassian.stash.internal.scm.git.transcode.DefaultTranscoder.transcode( ~[stash-scm-git-3.7.1.jar:na]
[INFO] [talledLocalContainer]   at com.atlassian.stash.internal.scm.git.transcode.DefaultTranscodeServer$TranscodeChannelHandler.transcode( [stash-scm-git-3.7.1.jar:na]
[INFO] [talledLocalContainer]   at com.atlassian.stash.internal.scm.git.transcode.DefaultTranscodeServer$ [stash-scm-git-3.7.1.jar:na]
[INFO] [talledLocalContainer]   at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$ [stash-platform-3.7.1.jar:na]
[INFO] [talledLocalContainer]   at java.util.concurrent.Executors$ [na:1.7.0_75]
[INFO] [talledLocalContainer]   at [na:1.7.0_75]
[INFO] [talledLocalContainer]   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201( [na:1.7.0_75]
[INFO] [talledLocalContainer]   at java.util.concurrent.ScheduledThreadPoolExecutor$ [na:1.7.0_75]
[INFO] [talledLocalContainer]   at java.util.concurrent.ThreadPoolExecutor.runWorker( [na:1.7.0_75]
[INFO] [talledLocalContainer]   at [na:1.7.0_75]
[INFO] [talledLocalContainer]   ... 1 frame trimmed

I'm running on Mac OSX 10.9.5 with javac 1.7.0_75

I installed the Atlassian plugin SDK with brew

brew install atlassian/tap/atlassian-plugin-sdk

created an empty plugin with


created a default post repository hook with


then started the server with


and when I browse to localhost I get the error above


seems i had a mis match in java versions. setting JAVA_HOME to the right version helped


Git Post-receive hook with part of work tree

I would like to use git to deploy to a website to a testing server. My website is a wordpress theme built with gulp and the repository looks like theme.git/ -- gulpfile.js -- src/ -- build/ I've followed the steps explained here and here which are- set up a bare...

Getting a list of files that were committed on a specific branch (git / Atlassian Stash)

How can I get a list of files (or commits) that were committed on a specific branch (where the branch is already deleted)? For example, I create TEST-123 feature branch from master, do a few commits to it, push to my central repo, and merge back to master via a...

Stop git commit in pre-commit hook with exit

I'm trying to stop a git commit from continuing with a pre-commit hook. From reading the manual, it should stop when you return an exit code other than 0. I'm testing to see if the csscomb command returns an error, and if it does then break the loop and exit,...

Git post-receive hook for push-to-deploy only works with master

I have a remote bare git repository created following: @server:~$ mkdir -p /home/myuser/domain.git && chmod 770 /home/myuser/domain.git && cd /home/myuser/domain.git && git init --bare With a post-receive hook: @server:~$ nano hooks/post-receive The hook script is: #!/bin/sh git --work-tree=/var/www/domain --git-dir=/home/myuser/domain.git checkout -f It has permission to execute: @server:~$ chmod +x hooks/post-receive...

Local Git Hook Pre-Commit/Pre-Push does not run (Windows)

I have a repo set up which is supposed to run a fairly simple pre-push/pre-commit powershell script (It doesn't really matter when the script executes). However, for the life of me I cannot get it to run. I have tried to use chmod +x .git/hooks/* and chmod ug+x .git/hooks/* I...

Can a pre-commit Git hook zip a directory and add it to the repository?

I'm doing development on a Wordpress plugin. My development directory contains a lot of development-specific stuff (e.g. Grunt files, Sass files, the git repository itself, etc.). Obviously, I don't want to distribute this folder containing all of those development files; people don't want a few MB of Grunt files when...

How to 'pipe' password to remote.update() with gitPython

I am trying to write a script (probably python) that needs to fetch a remote repo (housed with Stash via git), and checkout a specific commit (based on the hash). The problem is that this needs to happen 'blindly' to the user, but it pauses for a password. I need...

Failure to find com.atlassian.stash:stash-parent:pom:5.0.18

After working on jira and confluence, now working on stash. As per stash documentation i have created stash plugin but unable to convert eclipse compatible and running stash instance. pom.xml:- <?xml version="1.0" encoding="UTF-8"?>"> <modelVersion>4.0.0</modelVersion> <groupId>com.example.stash</groupId> <artifactId>stash-hook</artifactId> <version>1.0-SNAPSHOT</version> <organization> <name>Example Company</name>...

Git post-receive hook is not executed

The following post-receive hook: #!/bin/bash echo "-> Post-receive test" is not executed when pushing to my remote repository. The remote is ssh://[email protected]:2222/home/git/repo.git (it's a VM) and works, as when I manually checkout it I see the modifications I've made. Some additional informations ... $ ls -al /home/git drwxr-xr-x 7 git...

Integrating multiple git users with Asana

I've setup a Git server according to this page. I've also incorporated a post-receive hook according to this page. I'm using GitHub for Windows to communicate between my local machine and the git repo. My issue is that the post-receive hook utilizes a variable found in git config user.asana-key. I've...

local atlassian stash server error debugging plugin

Im trying to setup a dev environment to create a git hook plugin for Atlassian stash server. When I run atlas-debug to start the web server then browse to localhost:port The Stash home page doesn't display and I get this error in the console... [INFO] [talledLocalContainer] 2015-03-10 21:09:51,279 WARN [threadpool:thread-15]...

Automatically copy pushed files from one GitHub repository to another

I have two GitHub repositories. I'd like to automatically (probably using hooks and/or github API) commit and push files to the second repository when they are pushed to the first one. The second repository is not a clone of the first one, their folder layout is not necessarily the same...

Capistrano unable to pull a Stash repository using SSH

I followed the following procedure: Created an SSH key; Enabled SSH in Atlassian Stash; Added SSH key for the Stash account called Capistrano (already used by Capistrano to successfully connect using username and password to Stash) Tested the SSH connection using the command git clone ssh://[email protected]:7999/project/repository.git and the repository is...

Multiple git hooks for the same trigger

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...

Stash: is it possible to prevent direct pushes to repository?

We are using Atlassian Stash Git repository. We want all the team members to be able to approve pull requests to repository or some branches, but we want only several members or no one to be able to commit to repository without pull request. Also we would like to prevent...

How to git-diff a file against “theirs” version after resolving conflicts

In a pre-commit hook, I want to make sure that nobody (except 1 person) is able to change restricted_file.txt The hook needs to handle the case when someone performs 'git pull' or 'git merge some_branch', obtains the latest restricted_file.txt but something_else.txt causes a conflict. He resolves the conflict and keep...

Executing git-hooks on windows errors out

So, I have written a simple git-hooks for pre-push which works just fine on Linux or Mac, but doesn't work on Windows. Script: Tries to match the commit message with a regular expression, and should return 0 if matches or else exit. Based on the articles I read, they say...

Where are commit messages stored in Atlassian Stash

I am trying to write a plugin for Atlassian Stash. I have downloaded the SDK, and I have access to the database we use for Stash, but I am unable to find a table that has a column for commit messages. I assume that they aren't deriving that from the...

Why are Git post-receive hooks typically in bare repos?

Most mentions of post-receive hooks that I have seen are set up in bare repos. Why is this? If I only want pushes to the master branch to get deployed to my public_html folder, and all of my pushes are going to a bare repo with a post-receive hook, doesn't...

Redirecting a git push

I am currently playing with hooks to get our repositories to tell Jenkins to build, etc. I have been looking for information on how I would be able to redirect a push to another repo, or even if this is possible? So for example developer pushes to Dev repo, pre-push...

Jenkins CI Post-build Actions - How to push to Stash

I have Jenkins set up to monitor a private GitHub repo and currently is performing builds when I commit to GitHub using the GitHub Hook. Is it possible to set up an action to then push the same code to a Stash repo using 'Post-build Actions'? So just to clarify,...

Atlassian Stash - Permission Denied (publickey)

I'm actually in the process of setting Atlassian Stash for my Workplace. I've ran into this issue which I'm not able to fix. Note, this is running on a Windows 7 64bits installation. When setting the SSH Keys, I followed the Stash Guide on how to create them and set...

how to get a list of commits from refChanges in Atlassian Stash Pre Receive Repository Hook

Im trying to write a stash plugin that will iterate through the commits in a change set pushed to stash in a Pre Receive Repository Hook. The API passes a Collection of refChange in the onReceive method. public boolean onReceive(RepositoryHookContext context, Collection<RefChange> refChanges, HookResponse hookResponse) if I make 3 commits...

Git hooks in PHPStorm on Mac

I've got problem with commiting in PHPStorm with pre-commit hook enabled. #!/bin/sh cd "$(git rev-parse --show-toplevel)" # Message message () { if [ $2 -ne 0 ] then echo "${1}: Error" exit 1 else echo "${1}: Success" fi } # JSHint grunt lint:js &> /dev/null message "JSHint" $? # Unit...

Have JIRA send mails to watchers on commit from Stash on a ticket

Our workflow is as follows: Someone opens ticket in JIRA (ABC-123) Developer commits with commit message ("Do the thing, relates to ABC-123") Developer pushes to Stash server Commit will show on JIRA (and when viewed on Stash, ticket will linked to JIRA). Note: I'm not sure if the above workflow...

“Arguments to path.resolve must be strings” when calling 'gitbook build' from a Git hook

I am trying to run gitbook build within a post-receive Git hook on my (Gitlab, Debian 7, virtual private) server. Basically I want to: checkout the bare repository to a temporary dir run gitbook build in that temporary dir sync with the webspace through rsync The post-receive script runs something...

How to list merge conflicts on origin that are not on local?

Stash is rejecting my pull request due to merge conflicts. So I create a merge branch, merge destination into the merge branch, (there's nothing to commit), push anyway and open the pull request again. Still rejected for conflicts. I've deleted and recreated 3 times, and getting the same results each...

Git: pre-receive hook to allow only merges and not direct commits into master

I have a problem creating a pre-receive hook on a git remote branch, doing what I want. What's the problem? Direct commits to the master branch should be not allowed. Only merges into the master branch should be allowed. Solution My solution until now is to check, if there are...

Git push error pre-receive hook declined

I have run gitlabhq rails server on virtual machine, following 1-6 steps from this tutorial and starts rails server executing command sudo -u git -H bundle exec rails s -e production. After that I created user, using admin tools and created new project under this user. Then I'm trying...

Building a specific project within the master branch using Jenkins

In SVN, multiple projects are organized under "trunk". During migration, these projects ended up under "Master" in Stash. I have to configure Jenkins to build one of these projects within master. The Git plugin for Jenkins requests the Repo URL along with an optional branch name. However, this doesn't apply...

Development best practices: automatically grant permission to application's new folders

Some functionalities require new folders in my application and sometimes I need to grant write permissions to those folders. At the moment, when I upload the code to production environment, I need to manually grant those permissions in the server. When another person at my development team pulls my code...

If I'm using Atlassian Stash, can the git repo still be managed without using Stash?

I want to know if at some point, we decide to stop using Atlassian Stash, is it going to be possible to still access our git repos or will we be out of luck?

Stash Git error “fatal: remote error: CAPTCHA required”

Attempting to pull from my Stash project, using the following commands: $ git remote add origin https://[email protected]/scm/~username/project.git $ git pull origin develop I'm prompted for my password, which I enter and then get the following error: Your Stash account has been marked as requiring a CAPTCHA to be solved before...

git diff not working on a bare repo, post-receive hook

I am working on a post-receive hook on a bare repo. I want to get the file names that are changed and pushed in this bare repo (only the latest one). To get it i am using this command. git diff --name-only HEAD^ This gives me error when I push...