Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can we push to a refs/for/branchname in Stash

Mohan Krishnan April 8, 2013

Hello ,

Can we push commits / branch to refs/for/branchname in Stash server like gerrit . This can be used to stage changes for build and smoke test .

Regards,

Mohan

3 answers

0 votes
Adam
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 9, 2013

Yes it does. You'll need to install Ruby though.

Mohan Krishnan April 9, 2013

Does it requires installation of any external modules as well?

Mohan Krishnan April 9, 2013

I installed ruby on my win7 system and installed gem install atlassian-stash. How ever i get the following error when using stash configure . Any clue ?

C:\Ruby200-x64\bin>ruby.exe stash configure

C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/git-1.2.5/lib/git/lib.rb:700:in `command

': git version 2>&1:'git' is not recognized as an internal or external command

, (Git::GitExecuteError)

operable program or batch file.

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/git-1.2.5/lib/git/lib.rb:64

9:in `current_command_version'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/git-1.2.5/lib/git/lib.rb:65

9:in `meets_required_version?'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/git-1.2.5/lib/git.rb:30:in

`<top (required)>'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atlassian-stash-0.1.6/lib/a

tlassian/stash/pullrequest.rb:4:in `<top (required)>'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atlassian-stash-0.1.6/lib/s

tash_cli.rb:2:in `block in <top (required)>'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atlassian-stash-0.1.6/lib/s

tash_cli.rb:2:in `each'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atlassian-stash-0.1.6/lib/s

tash_cli.rb:2:in `<top (required)>'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:4

5:in `require'

from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atlassian-stash-0.1.6/bin/s

tash:4:in `<top (required)>'

from stash:23:in `load'

from stash:23:in `<main>'

Mohan Krishnan April 9, 2013

does this gem works with git 1.8.0 version?

Mohan Krishnan April 9, 2013

Was able to resolve the above issue . However after creating the Pull request using

stash pull-request mybranch master

i get the follwoing error :

An error occurred while executing an external process: 'C:\Program Files (x86)\Git\bin\git.exe update-ref refs/pull-requests/4/from 0c0ad54e1aa40190982c4eb103906e94b655ebd9' exited with code 128 saying: error: unable to create directory for refs/pull-requests/4/from fatal: Cannot lock the ref 'refs/pull-requests/4/from'.

Could you please help .


0 votes
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2013

Hi Mohan,

As Seb has indicated, you can obviuosly push changes to any ref. But we do not currently support the staging areas in the same way that Gerrit does. The Stash way is push your changes to a new branch and then create a pull request (which then may have automatic Bamboo builds). What I'd like to see at some stage is a plugin that creates those pull requests for you automatically based on the branch name. For now you could use Seb's awesome command line tool for Stash.

Charles

cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2013

Hi Mohan,

You might be interested in the following:

https://jira.atlassian.com/browse/STASH-2586

Charles

Mohan Krishnan April 9, 2013

Hi Charles,

As you indicated - " The Stash way is push your changes to a new branch and then create a pull request " . The only thing is see lacking here is user private branch support .Gerrit provides functionality for the creation of an access rule for "refs/heads/dev/${username}/*" branch. Essentially in our work flow we want that the developer should be able to push his branches onto some server, and be sure that nobody else can delete or overwrite them.

Mohan Krishnan April 9, 2013

Does the command line tool for Stash works in a windows 7 environment ?


0 votes
seb
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 9, 2013

Yes, you can commit to any ref you like.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events