scttnlsn / dandelion

Incremental Git repository deployment.
http://scttnlsn.github.io/dandelion
MIT License
738 stars 60 forks source link

Doesn't work with git submodules #37

Closed creativecoder closed 10 years ago

creativecoder commented 11 years ago

When I have a git submodule in my repository, it seems that once dandelion gets to that folder, it just throws errors and quits.

Current work around is to put the submodule in the list of ignored files/folders (in dandelion.yml) and then create a separate dandelion.yml file and deploy the submodule separately.

It would be nice if dandelion could just copy the files from the submodule.

bradt commented 11 years ago

+1

bradt commented 11 years ago

@creativecoder I tried your workaround, putting a dandelion.yml file in the submodule, but I get the following errors:

$ dandelion deploy
Connecting to sftp://@domainremoved.com/staging/public_html/wp
Invalid revision: HEAD
$ dandelion status
Connecting to sftp://@domainremoved.com/staging/public_html/wp
/Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/git.rb:58:in `initialize': Dandelion::Git::RevisionError (Dandelion::Git::RevisionError)
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/deployment.rb:23:in `new'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/deployment.rb:23:in `initialize'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/deployment.rb:82:in `initialize'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/deployment.rb:12:in `new'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/deployment.rb:12:in `create'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/command.rb:129:in `deployment'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/command/status.rb:15:in `execute'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/application.rb:38:in `execute'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/command.rb:92:in `initialize'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/application.rb:36:in `new'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/application.rb:36:in `execute'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/../lib/dandelion/application.rb:7:in `execute'
    from /Library/Ruby/Gems/1.8/gems/dandelion-0.3.11/bin/dandelion:7
    from /usr/bin/dandelion:23:in `load'
    from /usr/bin/dandelion:23

You come across this?

I thought it might be because my submodule was in a detached state, but I checked out the master branch and got the same errors.

creativecoder commented 11 years ago

I had to deploy the submodule separately. So,

bradt commented 11 years ago

I think I figured it out. The submodule was added using git submodule update which it seems is different than just doing a git clone (there is no .git directory for example). So, I removed the submodule directory then did a git clone instead and that has worked.

nicolasbinet commented 10 years ago

+1 @bradt I think that submodules should be defined through git submodule add, and recognized as such, or you'd loose the advandage. @creativecoder Can you deploy multiple submodules at once, or did you one dandelion.yml file by submodule ?

scttnlsn commented 10 years ago

https://github.com/scttnlsn/dandelion/issues/74