Skip to content

Restore support for git 1.6.x.x#102

Closed
nilbus wants to merge 1 commit into
capistrano:masterfrom
nilbus:git-1.6-support
Closed

Restore support for git 1.6.x.x#102
nilbus wants to merge 1 commit into
capistrano:masterfrom
nilbus:git-1.6-support

Conversation

@nilbus

@nilbus nilbus commented Sep 22, 2011

Copy link
Copy Markdown
Contributor

Fixes #96

Revert "improving behavior with git submodules"
This reverts commit 05c707c.

Conflicts:

lib/capistrano/recipes/deploy/scm/git.rb
test/deploy/scm/git_test.rb

Fixes capistrano#96

Revert "improving behavior with git submodules"
This reverts commit 05c707c.

Conflicts:

	lib/capistrano/recipes/deploy/scm/git.rb
	test/deploy/scm/git_test.rb
@nilbus

nilbus commented Sep 23, 2011

Copy link
Copy Markdown
Contributor Author

Still not sure why the change in 05c707c was made in the first place.

The git-submodule manpage:

   update
       If the submodule is not yet initialized, and you just want to use the setting as stored in .gitmodules, you can automatically initialize
       the submodule with the --init option.

But even before 05c707c, capistrano would run git init regardless. See 05c707c#L0L149

FYI, the error for servers with git 1.6.x.x:

  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    updating the cached checkout on all servers
Tag to deploy (make sure to push the tag first): [1.17.7]
    executing locally: "git ls-remote git@git.host:/project_name.git 1.17.7"
    command finished in 1564ms
  * executing "if [ -d /var/www/apps/project_name/shared/cached-copy ]; then cd /var/www/apps/project_name/shared/cached-copy && git fetch  origin && git reset  --hard 57f6a27810645d5437ae5251b1e5a843f38e78bf && git submodule  init && for mod in `git submodule status | awk '{ print $2 }'`; do git config -f .git/config submodule.${mod}.url `git config -f .gitmodules --get submodule.${mod}.url` && echo Synced $mod; done && git submodule  sync && git submodule  update && git clean  -d -x -f; else git clone  git@git.host:/project_name.git /var/www/apps/project_name/shared/cached-copy && cd /var/www/apps/project_name/shared/cached-copy && git checkout  -b deploy 57f6a27810645d5437ae5251b1e5a843f38e78bf && git submodule  init && git submodule  sync && git submodule  update --recursive; fi"
    servers: ["10.0.0.1"]
Password:
    [10.0.0.1] executing command
 ** [10.0.0.1 :: out] Initialized empty Git repository in /var/www/apps/project_name/shared/cached-copy/.git/
 ** [10.0.0.1 :: err] Switched to a new branch 'deploy'
 ** [10.0.0.1 :: out] Submodule 'vendor/plugins/capistrano_multistage' (git@git.host:/capistrano_multistage.git) registered for path 'vendor/plugins/capistrano_multistage'
 ** [10.0.0.1 :: out] Submodule 'vendor/plugins/capistrano_passenger' (git@git.host:/capistrano_passenger.git) registered for path 'vendor/plugins/capistrano_passenger'
 ** [10.0.0.1 :: out] Submodule 'vendor/plugins/capistrano_patch' (git@git.host:/capistrano_patch.git) registered for path 'vendor/plugins/capistrano_patch'
 ** [10.0.0.1 :: out] Submodule 'vendor/plugins/capistrano_shared_database_yml' (git@git.host:/capistrano_shared_database_yml.git) registered for path 'vendor/plugins/capistrano_shared_database_yml'
 ** [10.0.0.1 :: out] Submodule 'vendor/plugins/feedback_notifier' (git@git.host:/feedback_notifier.git) registered for path 'vendor/plugins/feedback_notifier'
 ** [10.0.0.1 :: err] Usage: git submodule [--quiet] [--cached] [add [-b branch] <repo> <path>]|[status|init|update [-i|--init] [-N|--no-fetch]|summary [-n|--summary-limit <n>] [<commit>]] [--] [<path>...]|[foreach <command>]|[sync [--] [<path>...]]
    command finished in 27929ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /var/www/apps/project_name/releases/20110922232946; true"
    servers: ["10.0.0.1"]
    [10.0.0.1] executing command
    command finished in 197ms
failed: "sh -c 'if [ -d /var/www/apps/project_name/shared/cached-copy ]; then cd /var/www/apps/project_name/shared/cached-copy && git fetch  origin && git reset  --hard 57f6a27810645d5437ae5251b1e5a843f38e78bf && git submodule  init && for mod in `git submodule status | awk '\\''{ print $2 }'\\''`; do git config -f .git/config submodule.${mod}.url `git config -f .gitmodules --get submodule.${mod}.url` && echo Synced $mod; done && git submodule  sync && git submodule  update && git clean  -d -x -f; else git clone  git@git.project_name:/project_name.git /var/www/apps/project_name/shared/cached-copy && cd /var/www/apps/project_name/shared/cached-copy && git checkout  -b deploy 57f6a27810645d5437ae5251b1e5a843f38e78bf && git submodule  init && git submodule  sync && git submodule  update --recursive; fi'" on 10.0.0.1

@nilbus

nilbus commented Sep 23, 2011

Copy link
Copy Markdown
Contributor Author

It looks like --recursive may actually be the problem instead of --init. This patch does not solve the problem.

@nilbus

nilbus commented Sep 23, 2011

Copy link
Copy Markdown
Contributor Author

Confirmed that --recursive is what's breaking in 1.6 and not --init. I'll open a new pull request later, since this patch is incorrect.

@nilbus nilbus closed this Sep 23, 2011
mattbrictson pushed a commit to mattbrictson/capistrano that referenced this pull request Aug 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression: git submodule update --recursive doesn't work on git 1.6

1 participant