I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Bug #2137

Git multiple options does not seem to work

Added by Alexandre Lessard over 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
04 Jan 2013
Due date:
19 May 2013
% Done:

100%

Redmine version:
2.0.3
External issue:

Description

Hi, I’ve been trying to use multiple option in the scm.yaml for my git repo and it doesn’t seem to work and it pass over all options.

I used it with "--bare” and it was working properly, but I wanted to add a template dir after that the "--bare” option was not even working.

So from this working code

production:
  auto_create: true
  deny_delete: false
  pre_create: /usr/local/bin/pre-create.sh
  post_create: /usr/local/bin/post-create.sh
  pre_delete: /usr/local/bin/pre-delete.sh
  post_delete: /usr/local/bin/post-delete.sh
  git:
    path: /path/to/repos
    git: /usr/bin/git
    options: --bare

To this not working code :

production:
  auto_create: true
  deny_delete: false
  pre_create: /usr/local/bin/pre-create.sh
  post_create: /usr/local/bin/post-create.sh
  pre_delete: /usr/local/bin/pre-delete.sh
  post_delete: /usr/local/bin/post-delete.sh
  git:
    path: /path/to/repos
    git: /usr/bin/git
    options:
      - --bare
      - --template=/path/to/template

when I do it manually with git it work, using this command line :
git init --bare --template=/path/to/template repo.git

Associated revisions

Revision 122 (diff)
Added by Andriy Lesyuk about 9 years ago

Applied fixes for #2135, #2137 and #2183

History

#1 Updated by Alexandre Lessard over 9 years ago

I’ve made some tests and the problem is about that line :

http://projects.andriylesyuk.com/projects/scm-creator/repository/entry/lib/creator/git_creator.rb#L61

append_options(args)

I’ve replaces it by :
args = append_options(args)

And now it works with me. Maybe there is something better to do.. but I’m a beginner un Ruby so it’s my solution.

#2 Updated by Alexandre Lessard over 9 years ago

The problem come from the fact that array + array = new array object so the reference is lost in the process.

The problem could also be resolved at :
http://projects.andriylesyuk.com/projects/scm-creator/repository/entry/lib/creator/scm_creator.rb#L143

replacing :
args += options['options']
By :

options['options'].each do |opt|
  args << opt
end 

#3 Updated by Andriy Lesyuk about 9 years ago

  • Status changed from New to Open
  • Assignee set to Andriy Lesyuk
  • Target version set to 0.4.3

Thanks for looking into it!

#4 Updated by Andriy Lesyuk about 9 years ago

  • Due date set to 19 May 2013
  • Status changed from Open to In Progress
  • % Done changed from 0 to 100

Changed to concat and push. It would be great, if you could ensure, that it works (going to commit changes soon).

#5 Updated by Andriy Lesyuk almost 9 years ago

  • Status changed from In Progress to Closed

Assuming it does...

Also available in: Atom PDF

Terms of use | Privacy policy