avm-tools 0.111.0 → 0.113.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (963) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/tools/app_src.rb +2 -2
  3. data/lib/avm/tools/runner/app_src/info.rb +2 -2
  4. data/lib/avm/tools/runner/{git → app_src}/issue/complete.rb +3 -2
  5. data/lib/avm/tools/runner/{git → app_src}/issue/deliver.rb +2 -2
  6. data/lib/avm/tools/runner/{git → app_src}/issue.rb +1 -2
  7. data/lib/avm/tools/runner/app_src/test.rb +69 -7
  8. data/lib/avm/tools/runner/config/load_path.rb +1 -1
  9. data/lib/avm/tools/runner/git/subrepo/fix.rb +3 -0
  10. data/lib/avm/tools/version.rb +1 -1
  11. data/sub/avm/Gemfile +5 -0
  12. data/sub/avm/avm.gemspec +26 -0
  13. data/sub/avm/lib/avm/data/instance/files_unit.rb +40 -0
  14. data/sub/avm/lib/avm/data/instance/package.rb +18 -0
  15. data/sub/avm/lib/avm/data/instance/unit.rb +17 -0
  16. data/{lib/avm/data.rb → sub/avm/lib/avm/data/instance.rb} +2 -0
  17. data/sub/avm/lib/avm/data/package/dump.rb +119 -0
  18. data/sub/avm/lib/avm/data/package/load.rb +48 -0
  19. data/sub/avm/lib/avm/data/package.rb +42 -0
  20. data/sub/avm/lib/avm/data/rotate.rb +107 -0
  21. data/sub/avm/lib/avm/data/unit.rb +94 -0
  22. data/sub/avm/lib/avm/docker/container.rb +50 -0
  23. data/sub/avm/lib/avm/docker/image.rb +71 -0
  24. data/sub/avm/lib/avm/docker/runner.rb +125 -0
  25. data/sub/avm/lib/avm/docker.rb +9 -0
  26. data/sub/avm/lib/avm/executables.rb +24 -0
  27. data/sub/avm/lib/avm/instances/application.rb +25 -0
  28. data/sub/avm/lib/avm/instances/base/auto_values/access.rb +40 -0
  29. data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +19 -0
  30. data/sub/avm/lib/avm/instances/base/auto_values/data.rb +26 -0
  31. data/sub/avm/lib/avm/instances/base/auto_values/database.rb +76 -0
  32. data/sub/avm/lib/avm/instances/base/auto_values/filesystem.rb +45 -0
  33. data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +34 -0
  34. data/sub/avm/lib/avm/instances/base/auto_values/ruby.rb +15 -0
  35. data/sub/avm/lib/avm/instances/base/auto_values/source.rb +15 -0
  36. data/sub/avm/lib/avm/instances/base/auto_values/system.rb +23 -0
  37. data/sub/avm/lib/avm/instances/base/auto_values/web.rb +46 -0
  38. data/sub/avm/lib/avm/instances/base/auto_values.rb +21 -0
  39. data/sub/avm/lib/avm/instances/base/dockerizable.rb +45 -0
  40. data/sub/avm/lib/avm/instances/base/entry_keys.rb +22 -0
  41. data/sub/avm/lib/avm/instances/base.rb +64 -0
  42. data/sub/avm/lib/avm/instances/docker_image.rb +15 -0
  43. data/sub/avm/lib/avm/instances/entries.rb +43 -0
  44. data/sub/avm/lib/avm/instances/entry.rb +54 -0
  45. data/sub/avm/lib/avm/instances/entry_keys.rb +57 -0
  46. data/sub/avm/lib/avm/instances/runner.rb +39 -0
  47. data/sub/avm/lib/avm/instances.rb +8 -0
  48. data/sub/avm/lib/avm/jobs/base.rb +63 -0
  49. data/sub/avm/lib/avm/jobs/variables_source.rb +22 -0
  50. data/sub/avm/lib/avm/jobs.rb +9 -0
  51. data/sub/avm/lib/avm/path_string.rb +27 -0
  52. data/sub/avm/lib/avm/registry/base.rb +67 -0
  53. data/sub/avm/lib/avm/registry.rb +29 -0
  54. data/sub/avm/lib/avm/result.rb +86 -0
  55. data/sub/avm/lib/avm/rspec/setup.rb +22 -0
  56. data/sub/avm/lib/avm/rspec/shared_examples/in_avm_registry.rb +11 -0
  57. data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +14 -0
  58. data/sub/avm/lib/avm/rspec.rb +9 -0
  59. data/sub/avm/lib/avm/runners/base.rb +27 -0
  60. data/sub/avm/lib/avm/scms/base.rb +33 -0
  61. data/sub/avm/lib/avm/scms/commit.rb +43 -0
  62. data/sub/avm/lib/avm/scms/inflector.rb +22 -0
  63. data/sub/avm/lib/avm/self/docker_image.rb +14 -0
  64. data/sub/avm/lib/avm/self/instance/entry_keys.rb +12 -0
  65. data/sub/avm/lib/avm/self/instance.rb +24 -0
  66. data/sub/avm/lib/avm/sources/base/configuration.rb +37 -0
  67. data/sub/avm/lib/avm/sources/base/testing.rb +21 -0
  68. data/sub/avm/lib/avm/sources/base.rb +51 -0
  69. data/sub/avm/lib/avm/sources/configuration/_locale.rb +16 -0
  70. data/sub/avm/lib/avm/sources/configuration/_rubocop.rb +24 -0
  71. data/sub/avm/lib/avm/sources/configuration/_tests.rb +27 -0
  72. data/sub/avm/lib/avm/sources/configuration.rb +55 -0
  73. data/sub/avm/lib/avm/sources/tester.rb +24 -0
  74. data/sub/avm/lib/avm/sources/tests/builder.rb +83 -0
  75. data/sub/avm/lib/avm/sources/tests/performer.rb +35 -0
  76. data/sub/avm/lib/avm/sources/tests/result.rb +15 -0
  77. data/sub/avm/lib/avm/sources/tests/single.rb +56 -0
  78. data/sub/avm/lib/avm/sources/tests.rb +11 -0
  79. data/sub/avm/lib/avm/sources.rb +9 -0
  80. data/sub/avm/lib/avm/sync.rb +94 -0
  81. data/sub/avm/lib/avm/version.rb +5 -0
  82. data/sub/avm/lib/avm/version_number.rb +45 -0
  83. data/sub/avm/lib/avm.rb +7 -0
  84. data/sub/avm/spec/lib/avm/scms/base_spec.rb +7 -0
  85. data/sub/avm/spec/lib/avm/sources/base_spec.rb +7 -0
  86. data/sub/avm/spec/rubocop_spec.rb +3 -0
  87. data/sub/avm/spec/spec_helper.rb +4 -0
  88. data/sub/avm-eac_asciidoctor_base0/Gemfile +5 -0
  89. data/sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +22 -0
  90. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/apache_host.rb +17 -0
  91. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/apache_path.rb +10 -0
  92. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/deploy.rb +26 -0
  93. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instance.rb +11 -0
  94. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb +16 -0
  95. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +30 -0
  96. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb +49 -0
  97. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +54 -0
  98. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner.rb +30 -0
  99. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources.rb +11 -0
  100. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +7 -0
  101. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0.rb +9 -0
  102. data/sub/avm-eac_asciidoctor_base0/spec/lib/avm/eac_asciidoctor_base0/sources/base_spec.rb +7 -0
  103. data/sub/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +3 -0
  104. data/sub/avm-eac_asciidoctor_base0/spec/spec_helper.rb +4 -0
  105. data/sub/avm-eac_generic_base0/Gemfile +5 -0
  106. data/sub/avm-eac_generic_base0/avm-eac_generic_base0.gemspec +19 -0
  107. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base.rb +22 -0
  108. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/tester.rb +56 -0
  109. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources.rb +11 -0
  110. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/version.rb +7 -0
  111. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0.rb +9 -0
  112. data/sub/avm-eac_generic_base0/spec/lib/avm/eac_generic_base0/sources/base_spec.rb +7 -0
  113. data/sub/avm-eac_generic_base0/spec/rubocop_spec.rb +3 -0
  114. data/sub/avm-eac_generic_base0/spec/spec_helper.rb +4 -0
  115. data/sub/avm-eac_rails_base0/Gemfile +5 -0
  116. data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +19 -0
  117. data/{lib → sub/avm-eac_rails_base0/lib}/avm/eac_rails_base0/apache_host.rb +0 -0
  118. data/{lib → sub/avm-eac_rails_base0/lib}/avm/eac_rails_base0/apache_path.rb +1 -0
  119. data/{lib → sub/avm-eac_rails_base0/lib}/avm/eac_rails_base0/deploy.rb +2 -0
  120. data/{lib → sub/avm-eac_rails_base0/lib}/avm/eac_rails_base0/instance.rb +0 -0
  121. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/patches/object/template.rb +7 -0
  122. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/patches/object.rb +4 -0
  123. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/patches.rb +4 -0
  124. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/runners/base.rb +24 -0
  125. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/runners.rb +11 -0
  126. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +7 -0
  127. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0.rb +9 -0
  128. data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_host_spec.rb +22 -0
  129. data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_host_spec_files/apache_host_spec_no_ssl_content.conf +11 -0
  130. data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_path_spec.rb +23 -0
  131. data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_path_spec_files/stub-app_0_apache_path.conf +14 -0
  132. data/sub/avm-eac_rails_base0/spec/rubocop_spec.rb +3 -0
  133. data/sub/avm-eac_rails_base0/spec/spec_helper.rb +4 -0
  134. data/{template → sub/avm-eac_rails_base0/template}/avm/eac_rails_base0/apache_path/extra_content.conf +0 -0
  135. data/{template → sub/avm-eac_rails_base0/template}/avm/eac_rails_base0/deploy/config/database.yml.template +0 -0
  136. data/{template → sub/avm-eac_rails_base0/template}/avm/eac_rails_base0/deploy/config/envvars.d/email.yml.template +0 -0
  137. data/sub/avm-eac_rails_base1/Gemfile +5 -0
  138. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +19 -0
  139. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/apache_host.rb +17 -0
  140. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instance.rb +24 -0
  141. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/bundle.rb +26 -0
  142. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/code_runner.rb +26 -0
  143. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb +43 -0
  144. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs/clear.rb +26 -0
  145. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs.rb +18 -0
  146. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/rails_server.rb +32 -0
  147. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner.rb +12 -0
  148. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +27 -0
  149. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +47 -0
  150. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +7 -0
  151. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1.rb +9 -0
  152. data/sub/avm-eac_rails_base1/spec/rubocop_spec.rb +3 -0
  153. data/sub/avm-eac_rails_base1/spec/spec_helper.rb +4 -0
  154. data/sub/avm-eac_redmine_base0/Gemfile +5 -0
  155. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +22 -0
  156. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/apache_host.rb +10 -0
  157. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/core_update.rb +111 -0
  158. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/data_unit.rb +55 -0
  159. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/deploy.rb +36 -0
  160. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instance.rb +37 -0
  161. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +82 -0
  162. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/patches/object/template.rb +7 -0
  163. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +7 -0
  164. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0.rb +9 -0
  165. data/sub/avm-eac_redmine_base0/spec/rubocop_spec.rb +3 -0
  166. data/sub/avm-eac_redmine_base0/spec/spec_helper.rb +4 -0
  167. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/deploy/config/install.sh.template +27 -0
  168. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/deploy/config/secrets.yml +8 -0
  169. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile.template +43 -0
  170. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_http_virtualhost.conf.template +10 -0
  171. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_https_virtualhost.conf.template +16 -0
  172. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/install_settings.sh.template +33 -0
  173. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/start.sh.template +52 -0
  174. data/sub/avm-eac_ruby_base1/Gemfile +5 -0
  175. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +21 -0
  176. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/patches/i18n.rb +7 -0
  177. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/patches.rb +4 -0
  178. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +39 -0
  179. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +38 -0
  180. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +56 -0
  181. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +53 -0
  182. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources.rb +11 -0
  183. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +7 -0
  184. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1.rb +9 -0
  185. data/sub/avm-eac_ruby_base1/locale/en.yaml +8 -0
  186. data/sub/avm-eac_ruby_base1/locale/pt-BR.yaml +8 -0
  187. data/sub/avm-eac_ruby_base1/spec/lib/avm/eac_ruby_base1/sources/base_spec.rb +7 -0
  188. data/sub/avm-eac_ruby_base1/spec/rubocop_spec.rb +3 -0
  189. data/sub/avm-eac_ruby_base1/spec/spec_helper.rb +4 -0
  190. data/sub/avm-eac_ubuntu_base0/Gemfile +5 -0
  191. data/sub/avm-eac_ubuntu_base0/avm-eac_ubuntu_base0.gemspec +20 -0
  192. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache/resource.rb +59 -0
  193. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache.rb +26 -0
  194. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/docker_image.rb +29 -0
  195. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances/base.rb +16 -0
  196. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances.rb +11 -0
  197. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/patches/object/template.rb +7 -0
  198. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base/docker.rb +19 -0
  199. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base.rb +24 -0
  200. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/version.rb +7 -0
  201. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0.rb +9 -0
  202. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/docker_image_spec.rb +16 -0
  203. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base_spec.rb +7 -0
  204. data/sub/avm-eac_ubuntu_base0/spec/rubocop_spec.rb +3 -0
  205. data/sub/avm-eac_ubuntu_base0/spec/spec_helper.rb +4 -0
  206. data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/docker_image/Dockerfile.template +24 -0
  207. data/sub/avm-eac_webapp_base0/Gemfile +5 -0
  208. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +20 -0
  209. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_host.rb +79 -0
  210. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb +51 -0
  211. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +25 -0
  212. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/build.rb +48 -0
  213. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb +42 -0
  214. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/git_info.rb +62 -0
  215. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/version.rb +24 -0
  216. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/write_on_target.rb +18 -0
  217. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy.rb +73 -0
  218. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +24 -0
  219. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance.rb +55 -0
  220. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_host.rb +35 -0
  221. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_path.rb +40 -0
  222. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/dump.rb +63 -0
  223. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/load.rb +55 -0
  224. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data.rb +17 -0
  225. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/deploy.rb +39 -0
  226. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner.rb +12 -0
  227. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources/base.rb +15 -0
  228. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources.rb +11 -0
  229. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +7 -0
  230. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0.rb +9 -0
  231. data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/sources/base_spec.rb +7 -0
  232. data/sub/avm-eac_webapp_base0/spec/rubocop_spec.rb +3 -0
  233. data/sub/avm-eac_webapp_base0/spec/spec_helper.rb +4 -0
  234. data/sub/avm-files/Gemfile +5 -0
  235. data/sub/avm-files/avm-files.gemspec +21 -0
  236. data/sub/avm-files/lib/avm/files/appendable/file_content.rb +24 -0
  237. data/sub/avm-files/lib/avm/files/appendable/plain_directory.rb +25 -0
  238. data/sub/avm-files/lib/avm/files/appendable/resource_base.rb +13 -0
  239. data/sub/avm-files/lib/avm/files/appendable/tar_output_command.rb +26 -0
  240. data/sub/avm-files/lib/avm/files/appendable/templatized_directory.rb +29 -0
  241. data/sub/avm-files/lib/avm/files/appendable.rb +55 -0
  242. data/sub/avm-files/lib/avm/files/appender.rb +11 -0
  243. data/sub/avm-files/lib/avm/files/deploy.rb +71 -0
  244. data/sub/avm-files/lib/avm/files/formatter/formats/base.rb +62 -0
  245. data/sub/avm-files/lib/avm/files/formatter/formats/generic_plain.rb +34 -0
  246. data/sub/avm-files/lib/avm/files/formatter/formats/html.rb +45 -0
  247. data/sub/avm-files/lib/avm/files/formatter/formats/javascript.rb +24 -0
  248. data/sub/avm-files/lib/avm/files/formatter/formats/json.rb +27 -0
  249. data/sub/avm-files/lib/avm/files/formatter/formats/php.rb +22 -0
  250. data/sub/avm-files/lib/avm/files/formatter/formats/python.rb +22 -0
  251. data/sub/avm-files/lib/avm/files/formatter/formats/ruby.rb +22 -0
  252. data/sub/avm-files/lib/avm/files/formatter/formats/xml.rb +28 -0
  253. data/sub/avm-files/lib/avm/files/formatter/formats.rb +13 -0
  254. data/sub/avm-files/lib/avm/files/formatter/utf8_assert.rb +74 -0
  255. data/sub/avm-files/lib/avm/files/formatter.rb +90 -0
  256. data/sub/avm-files/lib/avm/files/version.rb +7 -0
  257. data/sub/avm-files/lib/avm/files.rb +9 -0
  258. data/sub/avm-files/spec/rubocop_spec.rb +3 -0
  259. data/sub/avm-files/spec/spec_helper.rb +4 -0
  260. data/sub/avm-git/Gemfile +5 -0
  261. data/sub/avm-git/avm-git.gemspec +21 -0
  262. data/sub/avm-git/lib/avm/git/auto_commit/commit_info.rb +23 -0
  263. data/sub/avm-git/lib/avm/git/auto_commit/rules/base.rb +39 -0
  264. data/sub/avm-git/lib/avm/git/auto_commit/rules/last.rb +19 -0
  265. data/sub/avm-git/lib/avm/git/auto_commit/rules/manual.rb +45 -0
  266. data/sub/avm-git/lib/avm/git/auto_commit/rules/new.rb +24 -0
  267. data/sub/avm-git/lib/avm/git/auto_commit/rules/nth.rb +31 -0
  268. data/sub/avm-git/lib/avm/git/auto_commit/rules/unique.rb +21 -0
  269. data/sub/avm-git/lib/avm/git/auto_commit/rules.rb +31 -0
  270. data/sub/avm-git/lib/avm/git/auto_commit_path/ruby.rb +20 -0
  271. data/sub/avm-git/lib/avm/git/auto_commit_path.rb +28 -0
  272. data/sub/avm-git/lib/avm/git/commit/class_methods.rb +31 -0
  273. data/sub/avm-git/lib/avm/git/commit/deploy.rb +38 -0
  274. data/sub/avm-git/lib/avm/git/commit/deploy_methods.rb +19 -0
  275. data/sub/avm-git/lib/avm/git/commit/diff_tree_line.rb +32 -0
  276. data/sub/avm-git/lib/avm/git/commit/file.rb +46 -0
  277. data/sub/avm-git/lib/avm/git/commit.rb +59 -0
  278. data/sub/avm-git/lib/avm/git/file_auto_fixup.rb +83 -0
  279. data/sub/avm-git/lib/avm/git/issue/complete/commits.rb +42 -0
  280. data/sub/avm-git/lib/avm/git/issue/complete/git_subrepos.rb +23 -0
  281. data/sub/avm-git/lib/avm/git/issue/complete/local_branch.rb +54 -0
  282. data/sub/avm-git/lib/avm/git/issue/complete/local_tag.rb +39 -0
  283. data/sub/avm-git/lib/avm/git/issue/complete/push.rb +54 -0
  284. data/sub/avm-git/lib/avm/git/issue/complete/remote.rb +33 -0
  285. data/sub/avm-git/lib/avm/git/issue/complete/test.rb +40 -0
  286. data/sub/avm-git/lib/avm/git/issue/complete/tracker.rb +28 -0
  287. data/sub/avm-git/lib/avm/git/issue/complete/validation.rb +31 -0
  288. data/sub/avm-git/lib/avm/git/issue/complete/validations.rb +53 -0
  289. data/sub/avm-git/lib/avm/git/issue/complete/working_tree.rb +19 -0
  290. data/sub/avm-git/lib/avm/git/issue/complete.rb +51 -0
  291. data/sub/avm-git/lib/avm/git/issue/deliver.rb +56 -0
  292. data/{lib/avm/eac_rails_base0.rb → sub/avm-git/lib/avm/git/issue.rb} +3 -1
  293. data/sub/avm-git/lib/avm/git/organize/reference_update.rb +34 -0
  294. data/sub/avm-git/lib/avm/git/organize/repository.rb +76 -0
  295. data/sub/avm-git/lib/avm/git/organize.rb +11 -0
  296. data/sub/avm-git/lib/avm/git/revision_test.rb +105 -0
  297. data/sub/avm-git/lib/avm/git/scms/git/change_tracker.rb +35 -0
  298. data/sub/avm-git/lib/avm/git/scms/git/commit.rb +55 -0
  299. data/sub/avm-git/lib/avm/git/scms/git.rb +73 -0
  300. data/sub/avm-git/lib/avm/git/scms/git_subrepo.rb +41 -0
  301. data/sub/avm-git/lib/avm/git/scms/provider.rb +19 -0
  302. data/sub/avm-git/lib/avm/git/scms.rb +11 -0
  303. data/sub/avm-git/lib/avm/git/subrepo_check/parent.rb +51 -0
  304. data/sub/avm-git/lib/avm/git/subrepo_check/remote.rb +89 -0
  305. data/sub/avm-git/lib/avm/git/subrepo_check/show_result.rb +32 -0
  306. data/sub/avm-git/lib/avm/git/subrepo_check.rb +38 -0
  307. data/sub/avm-git/lib/avm/git/subrepo_checks.rb +59 -0
  308. data/sub/avm-git/lib/avm/git/version.rb +7 -0
  309. data/sub/avm-git/lib/avm/git.rb +11 -0
  310. data/sub/avm-git/spec/lib/avm/git/auto_commit_path_spec.rb +21 -0
  311. data/sub/avm-git/spec/lib/avm/git/commit/deploy_spec.rb +93 -0
  312. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec.rb +13 -0
  313. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.source.out +1 -0
  314. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.target.yaml +7 -0
  315. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.source.out +1 -0
  316. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.target.yaml +7 -0
  317. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.source.out +1 -0
  318. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.target.yaml +7 -0
  319. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.source.out +2 -0
  320. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.target.yaml +13 -0
  321. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.source.out +2 -0
  322. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.target.yaml +13 -0
  323. data/sub/avm-git/spec/lib/avm/git/commit_spec.rb +56 -0
  324. data/sub/avm-git/spec/lib/avm/git/scms/git_spec.rb +8 -0
  325. data/sub/avm-git/spec/lib/avm/git/scms/git_subrepo_spec.rb +8 -0
  326. data/sub/avm-git/spec/rubocop_spec.rb +3 -0
  327. data/sub/avm-git/spec/spec_helper.rb +4 -0
  328. data/sub/eac_cli/Gemfile +5 -0
  329. data/sub/eac_cli/eac_cli.gemspec +20 -0
  330. data/sub/eac_cli/lib/eac_cli/config/entry/options.rb +57 -0
  331. data/sub/eac_cli/lib/eac_cli/config/entry/undefined.rb +26 -0
  332. data/sub/eac_cli/lib/eac_cli/config/entry.rb +46 -0
  333. data/sub/eac_cli/lib/eac_cli/config.rb +21 -0
  334. data/sub/eac_cli/lib/eac_cli/core_ext.rb +6 -0
  335. data/sub/eac_cli/lib/eac_cli/default_runner.rb +14 -0
  336. data/sub/eac_cli/lib/eac_cli/definition/alternative.rb +80 -0
  337. data/sub/eac_cli/lib/eac_cli/definition/argument_option.rb +21 -0
  338. data/sub/eac_cli/lib/eac_cli/definition/base_option/initialize_args_parser.rb +47 -0
  339. data/sub/eac_cli/lib/eac_cli/definition/base_option.rb +66 -0
  340. data/sub/eac_cli/lib/eac_cli/definition/boolean_option.rb +27 -0
  341. data/sub/eac_cli/lib/eac_cli/definition/help_formatter.rb +77 -0
  342. data/sub/eac_cli/lib/eac_cli/definition/positional_argument.rb +61 -0
  343. data/sub/eac_cli/lib/eac_cli/definition.rb +99 -0
  344. data/sub/eac_cli/lib/eac_cli/enum.rb +45 -0
  345. data/sub/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +80 -0
  346. data/sub/eac_cli/lib/eac_cli/old_configs/password_entry_reader.rb +16 -0
  347. data/sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +44 -0
  348. data/sub/eac_cli/lib/eac_cli/old_configs/store_passwords_entry_reader.rb +25 -0
  349. data/sub/eac_cli/lib/eac_cli/old_configs.rb +35 -0
  350. data/sub/eac_cli/lib/eac_cli/old_configs_bridge.rb +39 -0
  351. data/sub/eac_cli/lib/eac_cli/parser/alternative/argv.rb +17 -0
  352. data/sub/eac_cli/lib/eac_cli/parser/alternative/double_dash.rb +24 -0
  353. data/sub/eac_cli/lib/eac_cli/parser/alternative/long_options.rb +37 -0
  354. data/sub/eac_cli/lib/eac_cli/parser/alternative/option_argument.rb +29 -0
  355. data/sub/eac_cli/lib/eac_cli/parser/alternative/options.rb +29 -0
  356. data/sub/eac_cli/lib/eac_cli/parser/alternative/positionals.rb +30 -0
  357. data/sub/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +47 -0
  358. data/sub/eac_cli/lib/eac_cli/parser/alternative.rb +92 -0
  359. data/sub/eac_cli/lib/eac_cli/parser/collector.rb +46 -0
  360. data/sub/eac_cli/lib/eac_cli/parser/error.rb +15 -0
  361. data/sub/eac_cli/lib/eac_cli/parser.rb +34 -0
  362. data/sub/eac_cli/lib/eac_cli/patches/object/runner_with.rb +26 -0
  363. data/sub/eac_cli/lib/eac_cli/patches/object.rb +5 -0
  364. data/sub/eac_cli/lib/eac_cli/patches.rb +4 -0
  365. data/sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb +46 -0
  366. data/sub/eac_cli/lib/eac_cli/runner/context.rb +36 -0
  367. data/sub/eac_cli/lib/eac_cli/runner/exit.rb +13 -0
  368. data/sub/eac_cli/lib/eac_cli/runner/instance_methods.rb +42 -0
  369. data/sub/eac_cli/lib/eac_cli/runner.rb +49 -0
  370. data/sub/eac_cli/lib/eac_cli/runner_with/help/builder/alternative.rb +56 -0
  371. data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +73 -0
  372. data/sub/eac_cli/lib/eac_cli/runner_with/help.rb +41 -0
  373. data/sub/eac_cli/lib/eac_cli/runner_with/subcommands/definition_concern.rb +10 -0
  374. data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +119 -0
  375. data/sub/eac_cli/lib/eac_cli/runner_with.rb +9 -0
  376. data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +50 -0
  377. data/sub/eac_cli/lib/eac_cli/speaker/_constants.rb +12 -0
  378. data/sub/eac_cli/lib/eac_cli/speaker/list.rb +61 -0
  379. data/sub/eac_cli/lib/eac_cli/speaker/options.rb +38 -0
  380. data/sub/eac_cli/lib/eac_cli/speaker.rb +127 -0
  381. data/sub/eac_cli/lib/eac_cli/version.rb +5 -0
  382. data/sub/eac_cli/lib/eac_cli.rb +7 -0
  383. data/sub/eac_cli/spec/lib/eac_cli/definition/alternative_spec.rb +18 -0
  384. data/sub/eac_cli/spec/lib/eac_cli/old_configs_spec.rb +14 -0
  385. data/sub/eac_cli/spec/lib/eac_cli/parser/alternative_spec.rb +140 -0
  386. data/sub/eac_cli/spec/lib/eac_cli/runner_spec.rb +129 -0
  387. data/sub/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +42 -0
  388. data/sub/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb +85 -0
  389. data/sub/eac_cli/spec/lib/eac_cli/speaker_spec.rb +32 -0
  390. data/sub/eac_cli/spec/rubocop_spec.rb +3 -0
  391. data/sub/eac_cli/spec/spec_helper.rb +4 -0
  392. data/sub/eac_config/Gemfile +5 -0
  393. data/sub/eac_config/eac_config.gemspec +19 -0
  394. data/sub/eac_config/lib/eac_config/entry.rb +49 -0
  395. data/sub/eac_config/lib/eac_config/entry_path.rb +41 -0
  396. data/sub/eac_config/lib/eac_config/envvars_node/entry.rb +54 -0
  397. data/sub/eac_config/lib/eac_config/envvars_node.rb +25 -0
  398. data/sub/eac_config/lib/eac_config/load_nodes_search.rb +39 -0
  399. data/sub/eac_config/lib/eac_config/load_path.rb +28 -0
  400. data/sub/eac_config/lib/eac_config/node.rb +67 -0
  401. data/sub/eac_config/lib/eac_config/node_entry.rb +18 -0
  402. data/sub/eac_config/lib/eac_config/node_uri.rb +38 -0
  403. data/sub/eac_config/lib/eac_config/old_configs/base.rb +43 -0
  404. data/sub/eac_config/lib/eac_config/old_configs/file.rb +47 -0
  405. data/sub/eac_config/lib/eac_config/old_configs.rb +75 -0
  406. data/sub/eac_config/lib/eac_config/paths_hash/entry_key_error.rb +8 -0
  407. data/sub/eac_config/lib/eac_config/paths_hash/node.rb +67 -0
  408. data/sub/eac_config/lib/eac_config/paths_hash/path_search.rb +39 -0
  409. data/sub/eac_config/lib/eac_config/paths_hash.rb +63 -0
  410. data/sub/eac_config/lib/eac_config/rspec/setup.rb +30 -0
  411. data/sub/eac_config/lib/eac_config/rspec.rb +9 -0
  412. data/sub/eac_config/lib/eac_config/version.rb +5 -0
  413. data/sub/eac_config/lib/eac_config/yaml_file_node/entry.rb +36 -0
  414. data/sub/eac_config/lib/eac_config/yaml_file_node.rb +47 -0
  415. data/sub/eac_config/lib/eac_config.rb +7 -0
  416. data/sub/eac_config/spec/lib/eac_config/entry_path_spec.rb +30 -0
  417. data/sub/eac_config/spec/lib/eac_config/envvars_node/entry_spec.rb +14 -0
  418. data/sub/eac_config/spec/lib/eac_config/envvars_node_spec.rb +40 -0
  419. data/sub/eac_config/spec/lib/eac_config/old_configs_spec.rb +46 -0
  420. data/sub/eac_config/spec/lib/eac_config/paths_hash_spec.rb +88 -0
  421. data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec.rb +52 -0
  422. data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1.yaml +6 -0
  423. data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_1.yaml +2 -0
  424. data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2/storage1_2_1.yaml +2 -0
  425. data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2.yaml +4 -0
  426. data/sub/eac_config/spec/rubocop_spec.rb +3 -0
  427. data/sub/eac_config/spec/spec_helper.rb +4 -0
  428. data/sub/eac_docker/Gemfile +5 -0
  429. data/sub/eac_docker/eac_docker.gemspec +19 -0
  430. data/sub/eac_docker/lib/eac_docker/container.rb +78 -0
  431. data/sub/eac_docker/lib/eac_docker/debug.rb +15 -0
  432. data/sub/eac_docker/lib/eac_docker/executables.rb +18 -0
  433. data/sub/eac_docker/lib/eac_docker/images/base.rb +14 -0
  434. data/sub/eac_docker/lib/eac_docker/images/coded.rb +43 -0
  435. data/sub/eac_docker/lib/eac_docker/images/named.rb +30 -0
  436. data/sub/eac_docker/lib/eac_docker/images/templatized.rb +41 -0
  437. data/sub/eac_docker/lib/eac_docker/images.rb +9 -0
  438. data/sub/eac_docker/lib/eac_docker/registry.rb +17 -0
  439. data/sub/eac_docker/lib/eac_docker/rspec/setup.rb +17 -0
  440. data/sub/eac_docker/lib/eac_docker/rspec.rb +9 -0
  441. data/sub/eac_docker/lib/eac_docker/version.rb +5 -0
  442. data/sub/eac_docker/lib/eac_docker.rb +7 -0
  443. data/sub/eac_docker/spec/lib/eac_docker/executables_spec.rb +9 -0
  444. data/sub/eac_docker/spec/lib/eac_docker/images/coded_spec.rb +12 -0
  445. data/sub/eac_docker/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile +1 -0
  446. data/sub/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb +18 -0
  447. data/sub/eac_docker/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile +1 -0
  448. data/sub/eac_docker/spec/rubocop_spec.rb +3 -0
  449. data/sub/eac_docker/spec/spec_helper.rb +4 -0
  450. data/sub/eac_fs/Gemfile +5 -0
  451. data/sub/eac_fs/eac_fs.gemspec +20 -0
  452. data/sub/eac_fs/lib/eac_fs/cache.rb +64 -0
  453. data/sub/eac_fs/lib/eac_fs/cached_download.rb +39 -0
  454. data/sub/eac_fs/lib/eac_fs/file_info.rb +29 -0
  455. data/sub/eac_fs/lib/eac_fs/logs/file.rb +50 -0
  456. data/sub/eac_fs/lib/eac_fs/logs.rb +59 -0
  457. data/sub/eac_fs/lib/eac_fs/patches/module/fs_cache.rb +10 -0
  458. data/sub/eac_fs/lib/eac_fs/patches/module.rb +4 -0
  459. data/sub/eac_fs/lib/eac_fs/patches/object/fs_cache.rb +17 -0
  460. data/sub/eac_fs/lib/eac_fs/patches/object.rb +4 -0
  461. data/sub/eac_fs/lib/eac_fs/patches/pathname/info.rb +12 -0
  462. data/sub/eac_fs/lib/eac_fs/patches/pathname.rb +4 -0
  463. data/sub/eac_fs/lib/eac_fs/patches.rb +4 -0
  464. data/sub/eac_fs/lib/eac_fs/traversable.rb +45 -0
  465. data/sub/eac_fs/lib/eac_fs/traverser.rb +76 -0
  466. data/sub/eac_fs/lib/eac_fs/version.rb +5 -0
  467. data/sub/eac_fs/lib/eac_fs.rb +7 -0
  468. data/sub/eac_fs/spec/lib/eac_fs/cache_spec.rb +32 -0
  469. data/sub/eac_fs/spec/rubocop_spec.rb +3 -0
  470. data/sub/eac_fs/spec/spec_helper.rb +4 -0
  471. data/sub/eac_git/Gemfile +5 -0
  472. data/sub/eac_git/eac_git.gemspec +20 -0
  473. data/sub/eac_git/lib/eac_git/executables.rb +48 -0
  474. data/sub/eac_git/lib/eac_git/local/commit/archive.rb +19 -0
  475. data/sub/eac_git/lib/eac_git/local/commit/changed_file.rb +46 -0
  476. data/sub/eac_git/lib/eac_git/local/commit/diff_tree_line.rb +32 -0
  477. data/sub/eac_git/lib/eac_git/local/commit.rb +72 -0
  478. data/sub/eac_git/lib/eac_git/local/dirty_files.rb +37 -0
  479. data/sub/eac_git/lib/eac_git/local/log.rb +17 -0
  480. data/sub/eac_git/lib/eac_git/local/remote.rb +27 -0
  481. data/sub/eac_git/lib/eac_git/local/subrepo/config.rb +43 -0
  482. data/sub/eac_git/lib/eac_git/local/subrepo.rb +49 -0
  483. data/sub/eac_git/lib/eac_git/local.rb +108 -0
  484. data/sub/eac_git/lib/eac_git/remote/ls_result.rb +20 -0
  485. data/sub/eac_git/lib/eac_git/remote.rb +19 -0
  486. data/sub/eac_git/lib/eac_git/rspec/setup.rb +23 -0
  487. data/sub/eac_git/lib/eac_git/rspec/stubbed_git_local_repo.rb +71 -0
  488. data/sub/eac_git/lib/eac_git/rspec.rb +9 -0
  489. data/sub/eac_git/lib/eac_git/version.rb +5 -0
  490. data/sub/eac_git/lib/eac_git.rb +7 -0
  491. data/sub/eac_git/spec/lib/eac_git/executables_spec.rb +13 -0
  492. data/sub/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec.rb +13 -0
  493. data/sub/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.source.out +1 -0
  494. data/sub/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.target.yaml +7 -0
  495. data/sub/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.source.out +1 -0
  496. data/sub/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.target.yaml +7 -0
  497. data/sub/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.source.out +1 -0
  498. data/sub/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.target.yaml +7 -0
  499. data/sub/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.source.out +2 -0
  500. data/sub/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.target.yaml +13 -0
  501. data/sub/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.source.out +2 -0
  502. data/sub/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.target.yaml +13 -0
  503. data/sub/eac_git/spec/lib/eac_git/local/commit_spec.rb +58 -0
  504. data/sub/eac_git/spec/rubocop_spec.rb +3 -0
  505. data/sub/eac_git/spec/spec_helper.rb +4 -0
  506. data/sub/eac_git/vendor/git-subrepo/Changes +110 -0
  507. data/sub/eac_git/vendor/git-subrepo/Intro.pod +509 -0
  508. data/sub/eac_git/vendor/git-subrepo/License +21 -0
  509. data/sub/eac_git/vendor/git-subrepo/Makefile +82 -0
  510. data/sub/eac_git/vendor/git-subrepo/Meta +28 -0
  511. data/sub/eac_git/vendor/git-subrepo/ReadMe.pod +698 -0
  512. data/sub/eac_git/vendor/git-subrepo/doc/comparison.swim +35 -0
  513. data/sub/eac_git/vendor/git-subrepo/doc/git-subrepo.swim +608 -0
  514. data/sub/eac_git/vendor/git-subrepo/doc/intro-to-subrepo.swim +387 -0
  515. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/Changes +15 -0
  516. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/License +21 -0
  517. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/Makefile +45 -0
  518. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/Meta +28 -0
  519. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/ReadMe.pod +77 -0
  520. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/bin/bash+ +43 -0
  521. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/doc/bash+.swim +61 -0
  522. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/lib/bash+.bash +92 -0
  523. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/man/man1/bash+.1 +134 -0
  524. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/man/man3/bash+.3 +134 -0
  525. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/test/base.t +12 -0
  526. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/test/fcopy.t +22 -0
  527. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/test/lib/foo/bar.bash +3 -0
  528. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/test/lib/foo/foo.bash +3 -0
  529. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/test/source-bash+-std.t +18 -0
  530. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/test/source-bash+.t +23 -0
  531. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/test/test.bash +70 -0
  532. data/sub/eac_git/vendor/git-subrepo/ext/bashplus/test/use.t +19 -0
  533. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/Changes +15 -0
  534. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/License +21 -0
  535. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/Makefile +20 -0
  536. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/Meta +30 -0
  537. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ReadMe.pod +115 -0
  538. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim +89 -0
  539. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Changes +15 -0
  540. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/License +21 -0
  541. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Makefile +45 -0
  542. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Meta +28 -0
  543. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/ReadMe.pod +77 -0
  544. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ +43 -0
  545. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/doc/bash+.swim +61 -0
  546. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash +92 -0
  547. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man1/bash+.1 +134 -0
  548. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man3/bash+.3 +134 -0
  549. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/base.t +12 -0
  550. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/fcopy.t +22 -0
  551. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/lib/foo/bar.bash +3 -0
  552. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/lib/foo/foo.bash +3 -0
  553. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+-std.t +18 -0
  554. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+.t +23 -0
  555. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/test.bash +70 -0
  556. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/use.t +19 -0
  557. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Changes +15 -0
  558. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/License +21 -0
  559. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Makefile +37 -0
  560. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Meta +28 -0
  561. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/ReadMe.pod +66 -0
  562. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/doc/test-tap.swim +48 -0
  563. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash +153 -0
  564. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/man/man3/test-tap.3 +119 -0
  565. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/bail_out.t +13 -0
  566. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/done.t +10 -0
  567. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail.t +20 -0
  568. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail_fast.t +15 -0
  569. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/helper.bash +9 -0
  570. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/pass.t +9 -0
  571. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/plan.t +10 -0
  572. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/skip_all.t +20 -0
  573. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/tap.t +13 -0
  574. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/bail.t +14 -0
  575. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/fail.t +7 -0
  576. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/fail_fast.t +12 -0
  577. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-init.t +8 -0
  578. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/test/skip-all-plan.t +9 -0
  579. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/lib/test/more.bash +95 -0
  580. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/man/man3/test-more.3 +173 -0
  581. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/test/fail.t +20 -0
  582. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/test/more.t +20 -0
  583. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/test/pass.t +9 -0
  584. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/test/setup +8 -0
  585. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/test/skip_all.t +11 -0
  586. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/test/test/fail1.t +12 -0
  587. data/sub/eac_git/vendor/git-subrepo/ext/test-more-bash/test/test/skip_all.t +10 -0
  588. data/sub/eac_git/vendor/git-subrepo/lib/git-subrepo +1903 -0
  589. data/sub/eac_git/vendor/git-subrepo/lib/git-subrepo.d/bash+.bash +1 -0
  590. data/sub/eac_git/vendor/git-subrepo/lib/git-subrepo.d/help-functions.bash +339 -0
  591. data/sub/eac_git/vendor/git-subrepo/man/man1/git-subrepo.1 +743 -0
  592. data/sub/eac_git/vendor/git-subrepo/note/0.4.0 +12 -0
  593. data/sub/eac_git/vendor/git-subrepo/note/AllGitCmds +148 -0
  594. data/sub/eac_git/vendor/git-subrepo/note/Cases +32 -0
  595. data/sub/eac_git/vendor/git-subrepo/note/Commands +33 -0
  596. data/sub/eac_git/vendor/git-subrepo/note/Dags +199 -0
  597. data/sub/eac_git/vendor/git-subrepo/note/Gists +7 -0
  598. data/sub/eac_git/vendor/git-subrepo/note/Links +25 -0
  599. data/sub/eac_git/vendor/git-subrepo/note/Plugins +10 -0
  600. data/sub/eac_git/vendor/git-subrepo/note/Spec +39 -0
  601. data/sub/eac_git/vendor/git-subrepo/note/Story1 +57 -0
  602. data/sub/eac_git/vendor/git-subrepo/note/ToDo +55 -0
  603. data/sub/eac_git/vendor/git-subrepo/note/design.swim +137 -0
  604. data/sub/eac_git/vendor/git-subrepo/note/design2.swim +85 -0
  605. data/sub/eac_git/vendor/git-subrepo/note/init-test +38 -0
  606. data/sub/eac_git/vendor/git-subrepo/note/pull-dance.txt +18 -0
  607. data/sub/eac_git/vendor/git-subrepo/note/recreate-rebase-conflict.sh +56 -0
  608. data/sub/eac_git/vendor/git-subrepo/note/subtree-rebase-fail-example/test.bash +29 -0
  609. data/sub/eac_git/vendor/git-subrepo/note/test-subrepo-push.sh +69 -0
  610. data/sub/eac_git/vendor/git-subrepo/note/test.sh +58 -0
  611. data/sub/eac_git/vendor/git-subrepo/pkg/bin/generate-completion.pl +210 -0
  612. data/sub/eac_git/vendor/git-subrepo/pkg/bin/generate-help-functions.pl +89 -0
  613. data/sub/eac_git/vendor/git-subrepo/share/completion.bash +42 -0
  614. data/sub/eac_git/vendor/git-subrepo/share/enable-completion.sh +50 -0
  615. data/sub/eac_git/vendor/git-subrepo/share/git-completion.bash +2738 -0
  616. data/sub/eac_git/vendor/git-subrepo/share/zsh-completion/_git-subrepo +81 -0
  617. data/sub/eac_git/vendor/git-subrepo/test/branch-all.t +41 -0
  618. data/sub/eac_git/vendor/git-subrepo/test/branch-rev-list-one-path.t +43 -0
  619. data/sub/eac_git/vendor/git-subrepo/test/branch-rev-list.t +47 -0
  620. data/sub/eac_git/vendor/git-subrepo/test/branch.t +52 -0
  621. data/sub/eac_git/vendor/git-subrepo/test/clean.t +43 -0
  622. data/sub/eac_git/vendor/git-subrepo/test/clone-annotated-tag.t +45 -0
  623. data/sub/eac_git/vendor/git-subrepo/test/clone.t +107 -0
  624. data/sub/eac_git/vendor/git-subrepo/test/compile.t +19 -0
  625. data/sub/eac_git/vendor/git-subrepo/test/config.t +58 -0
  626. data/sub/eac_git/vendor/git-subrepo/test/encode.t +91 -0
  627. data/sub/eac_git/vendor/git-subrepo/test/error.t +171 -0
  628. data/sub/eac_git/vendor/git-subrepo/test/fetch.t +43 -0
  629. data/sub/eac_git/vendor/git-subrepo/test/gitignore.t +61 -0
  630. data/sub/eac_git/vendor/git-subrepo/test/init.t +64 -0
  631. data/sub/eac_git/vendor/git-subrepo/test/issue29.t +98 -0
  632. data/sub/eac_git/vendor/git-subrepo/test/issue95.t +98 -0
  633. data/sub/eac_git/vendor/git-subrepo/test/issue96.t +96 -0
  634. data/sub/eac_git/vendor/git-subrepo/test/pull-all.t +38 -0
  635. data/sub/eac_git/vendor/git-subrepo/test/pull-merge.t +113 -0
  636. data/sub/eac_git/vendor/git-subrepo/test/pull-message.t +88 -0
  637. data/sub/eac_git/vendor/git-subrepo/test/pull-new-branch.t +58 -0
  638. data/sub/eac_git/vendor/git-subrepo/test/pull-ours.t +90 -0
  639. data/sub/eac_git/vendor/git-subrepo/test/pull-theirs.t +82 -0
  640. data/sub/eac_git/vendor/git-subrepo/test/pull-twice.t +44 -0
  641. data/sub/eac_git/vendor/git-subrepo/test/pull-worktree.t +40 -0
  642. data/sub/eac_git/vendor/git-subrepo/test/pull.t +99 -0
  643. data/sub/eac_git/vendor/git-subrepo/test/push-after-init.t +51 -0
  644. data/sub/eac_git/vendor/git-subrepo/test/push-force.t +56 -0
  645. data/sub/eac_git/vendor/git-subrepo/test/push-new-branch.t +61 -0
  646. data/sub/eac_git/vendor/git-subrepo/test/push-no-changes.t +29 -0
  647. data/sub/eac_git/vendor/git-subrepo/test/push-squash.t +56 -0
  648. data/sub/eac_git/vendor/git-subrepo/test/push.t +176 -0
  649. data/sub/eac_git/vendor/git-subrepo/test/reclone.t +45 -0
  650. data/sub/eac_git/vendor/git-subrepo/test/repo/bar/HEAD +1 -0
  651. data/sub/eac_git/vendor/git-subrepo/test/repo/bar/config +4 -0
  652. data/sub/eac_git/vendor/git-subrepo/test/repo/bar/objects/1f/0c4b264caed0126814a0ede851a1e0b4e16ae6 +0 -0
  653. data/sub/eac_git/vendor/git-subrepo/test/repo/bar/objects/87/46903fdb1b9c2101377880125917c2e05b4d69 +0 -0
  654. data/sub/eac_git/vendor/git-subrepo/test/repo/bar/objects/94/c86ffc745232d89f78c6f895e11e71272518db +0 -0
  655. data/sub/eac_git/vendor/git-subrepo/test/repo/bar/objects/c6/76c57b6576743fa56278527aa60ebd2e202a7c +0 -0
  656. data/sub/eac_git/vendor/git-subrepo/test/repo/bar/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +0 -0
  657. data/sub/eac_git/vendor/git-subrepo/test/repo/bar/objects/f6/2a8ff3feadf39b0a98f1a86ec6d1eb33858ee9 +0 -0
  658. data/sub/eac_git/vendor/git-subrepo/test/repo/bar/refs/heads/master +1 -0
  659. data/sub/eac_git/vendor/git-subrepo/test/repo/bar/refs/tags/A +1 -0
  660. data/sub/eac_git/vendor/git-subrepo/test/repo/foo/HEAD +1 -0
  661. data/sub/eac_git/vendor/git-subrepo/test/repo/foo/config +4 -0
  662. data/sub/eac_git/vendor/git-subrepo/test/repo/foo/objects/a0/f4cdaaf533a936296cdebbed8206c3b9ededa8 +0 -0
  663. data/sub/eac_git/vendor/git-subrepo/test/repo/foo/objects/e2/1291a1ad392a9d4c51dd9586804f1467b28afd +0 -0
  664. data/sub/eac_git/vendor/git-subrepo/test/repo/foo/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +0 -0
  665. data/sub/eac_git/vendor/git-subrepo/test/repo/foo/refs/heads/master +1 -0
  666. data/sub/eac_git/vendor/git-subrepo/test/repo/init/HEAD +1 -0
  667. data/sub/eac_git/vendor/git-subrepo/test/repo/init/config +5 -0
  668. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/11/523f5dcf03b4c89b592dc8a3d0308f68da2386 +0 -0
  669. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/14/2addf8ec5f37334e837440122c62f2c68a29ad +0 -0
  670. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/32/5180321750a21cd7a4e7ecda319e557a4f6a09 +2 -0
  671. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/3d/918c6901c02f43af5d31779dd5e1f9166aeb36 +0 -0
  672. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/3e/4cb596066dce63ba4d047abddb677389b65e19 +0 -0
  673. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/4b/6e53022e7a04f07887697e4f3d7c377fd9822b +0 -0
  674. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/58/931fc1bd559b59c41ea738fc7ad04f9ad01bd3 +0 -0
  675. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/5e/c0c28e1b806f25efdca18fcf7a74b49c3755bd +0 -0
  676. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/75/fa6584e748f57eff06eebdc55e9ac21d4fcbf2 +1 -0
  677. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/80/2d5edbd5e1cb7fca82b5bd38e7c8a0a496fb20 +0 -0
  678. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/94/7b3d714c38791e95ad6f928b48c98bb8708acd +0 -0
  679. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/95/e1f2df3f4d5f3d7a60588c25a7ca8a913d3c2a +1 -0
  680. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/b1/5f4a7666baf40d949548ead946a3370e273479 +0 -0
  681. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/c3/ee8978c4c5d84c3b7d00ba8e5906933d027882 +0 -0
  682. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/c8/b0bffbc405ef3fad7354ff833fbec36d67ddfa +3 -0
  683. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/dd/8bdb934ec848137f011fe423b185505c343626 +2 -0
  684. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/e2/9be58c767cfeb27235c995d293a7d71aac0135 +2 -0
  685. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/ee/1224401fc6aac595145fa727dcf6706ac8aec1 +1 -0
  686. data/sub/eac_git/vendor/git-subrepo/test/repo/init/objects/f1/cc1a657b2e805c400f5dcaaa76bd29c6178b1b +0 -0
  687. data/sub/eac_git/vendor/git-subrepo/test/repo/init/refs/heads/master +1 -0
  688. data/sub/eac_git/vendor/git-subrepo/test/setup +205 -0
  689. data/sub/eac_git/vendor/git-subrepo/test/status.t +68 -0
  690. data/sub/eac_git/vendor/git-subrepo/test/submodule.t +45 -0
  691. data/sub/eac_ruby_base0/Gemfile +5 -0
  692. data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +21 -0
  693. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +83 -0
  694. data/sub/eac_ruby_base0/lib/eac_ruby_base0/application_xdg.rb +34 -0
  695. data/sub/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +5 -0
  696. data/sub/eac_ruby_base0/lib/eac_ruby_base0/jobs_runner.rb +31 -0
  697. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class/jobs_runner.rb +10 -0
  698. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/class.rb +4 -0
  699. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +5 -0
  700. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +5 -0
  701. data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches.rb +4 -0
  702. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner/test_all.rb +22 -0
  703. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +73 -0
  704. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/confirmation.rb +42 -0
  705. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +52 -0
  706. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +36 -0
  707. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +58 -0
  708. data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with.rb +9 -0
  709. data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +5 -0
  710. data/sub/eac_ruby_base0/lib/eac_ruby_base0.rb +7 -0
  711. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/confirmation_spec.rb +42 -0
  712. data/sub/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +81 -0
  713. data/sub/eac_ruby_base0/spec/rubocop_spec.rb +3 -0
  714. data/sub/eac_ruby_base0/spec/spec_helper.rb +4 -0
  715. data/sub/eac_ruby_gems_utils/Gemfile +5 -0
  716. data/sub/eac_ruby_gems_utils/LICENCE +16 -0
  717. data/sub/eac_ruby_gems_utils/README.rdoc +3 -0
  718. data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +31 -0
  719. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/command.rb +33 -0
  720. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +41 -0
  721. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +97 -0
  722. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +57 -0
  723. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/minitest.rb +25 -0
  724. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +48 -0
  725. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb +25 -0
  726. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +84 -0
  727. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/rspec.rb +21 -0
  728. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests.rb +9 -0
  729. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +5 -0
  730. data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils.rb +7 -0
  731. data/sub/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +3 -0
  732. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb +14 -0
  733. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb +7 -0
  734. data/sub/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem_spec.rb +20 -0
  735. data/sub/eac_ruby_gems_utils/spec/spec_helper.rb +4 -0
  736. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile +5 -0
  737. data/sub/eac_ruby_gems_utils/spec/support/mygem/Gemfile.lock +19 -0
  738. data/sub/eac_ruby_gems_utils/spec/support/mygem/Rakefile +14 -0
  739. data/sub/eac_ruby_gems_utils/spec/support/mygem/exe/myrunner +5 -0
  740. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem/version.rb +5 -0
  741. data/sub/eac_ruby_gems_utils/spec/support/mygem/lib/mygem.rb +5 -0
  742. data/sub/eac_ruby_gems_utils/spec/support/mygem/mygem.gemspec +16 -0
  743. data/sub/eac_ruby_utils/Gemfile +16 -0
  744. data/sub/eac_ruby_utils/MIT-LICENCE +16 -0
  745. data/sub/eac_ruby_utils/README.rdoc +3 -0
  746. data/sub/eac_ruby_utils/eac_ruby_utils.gemspec +23 -0
  747. data/sub/eac_ruby_utils/lib/eac_ruby_utils/abstract_methods.rb +68 -0
  748. data/sub/eac_ruby_utils/lib/eac_ruby_utils/arguments_consumer.rb +81 -0
  749. data/sub/eac_ruby_utils/lib/eac_ruby_utils/blank_not_blank.rb +19 -0
  750. data/sub/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb +31 -0
  751. data/sub/eac_ruby_utils/lib/eac_ruby_utils/by_reference.rb +23 -0
  752. data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_concern/class_setup.rb +52 -0
  753. data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_concern/module_setup.rb +41 -0
  754. data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb +20 -0
  755. data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb +29 -0
  756. data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/instance_initialize.rb +53 -0
  757. data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/super_args.rb +54 -0
  758. data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +89 -0
  759. data/sub/eac_ruby_utils/lib/eac_ruby_utils/compact.rb +22 -0
  760. data/sub/eac_ruby_utils/lib/eac_ruby_utils/compare_by.rb +28 -0
  761. data/sub/eac_ruby_utils/lib/eac_ruby_utils/context.rb +31 -0
  762. data/sub/eac_ruby_utils/lib/eac_ruby_utils/contextualizable.rb +21 -0
  763. data/sub/eac_ruby_utils/lib/eac_ruby_utils/core_ext.rb +6 -0
  764. data/sub/eac_ruby_utils/lib/eac_ruby_utils/custom_format.rb +53 -0
  765. data/sub/eac_ruby_utils/lib/eac_ruby_utils/enum.rb +102 -0
  766. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_env.rb +28 -0
  767. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/concat.rb +33 -0
  768. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb +24 -0
  769. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/extra_options.rb +33 -0
  770. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command.rb +172 -0
  771. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +63 -0
  772. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/file.rb +22 -0
  773. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/local_env.rb +17 -0
  774. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/process.rb +19 -0
  775. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/spawn.rb +32 -0
  776. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/dasho_options.rb +53 -0
  777. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/identity_file.rb +25 -0
  778. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/quiet.rb +24 -0
  779. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/terminal.rb +34 -0
  780. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env.rb +75 -0
  781. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs.rb +23 -0
  782. data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/clearable_directory.rb +57 -0
  783. data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/extname.rb +30 -0
  784. data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/temp/directory.rb +16 -0
  785. data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/temp/file.rb +34 -0
  786. data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs/temp.rb +52 -0
  787. data/sub/eac_ruby_utils/lib/eac_ruby_utils/fs.rb +9 -0
  788. data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +79 -0
  789. data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +35 -0
  790. data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/array_accessor.rb +32 -0
  791. data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/base_accessor.rb +23 -0
  792. data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/boolean_accessor.rb +16 -0
  793. data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb +20 -0
  794. data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/common_accessor.rb +30 -0
  795. data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/hash_accessor.rb +46 -0
  796. data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/instance_methods.rb +21 -0
  797. data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable.rb +15 -0
  798. data/sub/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +29 -0
  799. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/class_methods.rb +14 -0
  800. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/instance_methods.rb +30 -0
  801. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/integer_list.rb +23 -0
  802. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +99 -0
  803. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/lists.rb +59 -0
  804. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/string_list.rb +19 -0
  805. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/symbol_list.rb +19 -0
  806. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +39 -0
  807. data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable.rb +17 -0
  808. data/sub/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +48 -0
  809. data/sub/eac_ruby_utils/lib/eac_ruby_utils/options_consumer.rb +62 -0
  810. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patch.rb +11 -0
  811. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/abstract.rb +9 -0
  812. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/common_constructor.rb +9 -0
  813. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/self_included_modules.rb +7 -0
  814. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class/settings_provider.rb +10 -0
  815. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/class.rb +4 -0
  816. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerable/boolean_combinations.rb +45 -0
  817. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerable.rb +4 -0
  818. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/current.rb +9 -0
  819. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator/stopped.rb +14 -0
  820. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/enumerator.rb +4 -0
  821. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/options_consumer.rb +10 -0
  822. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash/sym_keys_hash.rb +10 -0
  823. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/hash.rb +5 -0
  824. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +10 -0
  825. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel.rb +4 -0
  826. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/abstract_methods.rb +10 -0
  827. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/common_concern.rb +9 -0
  828. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/compare_by.rb +9 -0
  829. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/context.rb +11 -0
  830. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/i18n_translate.rb +32 -0
  831. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/immutable.rb +10 -0
  832. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/listable.rb +10 -0
  833. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/patch.rb +9 -0
  834. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/require_sub.rb +9 -0
  835. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/simple_cache.rb +10 -0
  836. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/speaker.rb +9 -0
  837. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module.rb +4 -0
  838. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/asserts.rb +14 -0
  839. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/call_if_proc.rb +11 -0
  840. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/compact.rb +20 -0
  841. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +17 -0
  842. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/i18n_translate.rb +13 -0
  843. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_nil.rb +17 -0
  844. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_present.rb +19 -0
  845. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_respond.rb +22 -0
  846. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/to_pathname.rb +15 -0
  847. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object.rb +5 -0
  848. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb +9 -0
  849. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/parent_n.rb +11 -0
  850. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname.rb +4 -0
  851. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/if_match.rb +16 -0
  852. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/to_parser.rb +10 -0
  853. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp.rb +4 -0
  854. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/string/delimited.rb +16 -0
  855. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +11 -0
  856. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/string.rb +4 -0
  857. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/time/required_zone.rb +11 -0
  858. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/time.rb +4 -0
  859. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches.rb +4 -0
  860. data/sub/eac_ruby_utils/lib/eac_ruby_utils/recursive_builder.rb +51 -0
  861. data/sub/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +34 -0
  862. data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +81 -0
  863. data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +20 -0
  864. data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/conditionals.rb +17 -0
  865. data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +12 -0
  866. data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup_manager.rb +49 -0
  867. data/sub/eac_ruby_utils/lib/eac_ruby_utils/rspec.rb +9 -0
  868. data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb +32 -0
  869. data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_clean_environment.rb +26 -0
  870. data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby.rb +9 -0
  871. data/sub/eac_ruby_utils/lib/eac_ruby_utils/settings_provider/setting_value.rb +69 -0
  872. data/sub/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +46 -0
  873. data/sub/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +77 -0
  874. data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker/receiver.rb +57 -0
  875. data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker/sender.rb +32 -0
  876. data/sub/eac_ruby_utils/lib/eac_ruby_utils/speaker.rb +16 -0
  877. data/sub/eac_ruby_utils/lib/eac_ruby_utils/string_delimited.rb +70 -0
  878. data/sub/eac_ruby_utils/lib/eac_ruby_utils/struct.rb +63 -0
  879. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +5 -0
  880. data/sub/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb +105 -0
  881. data/sub/eac_ruby_utils/lib/eac_ruby_utils.rb +6 -0
  882. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/abstract_methods_spec.rb +28 -0
  883. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/arguments_consumer_spec.rb +17 -0
  884. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/blank_not_blank_spec.rb +16 -0
  885. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb +65 -0
  886. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb +125 -0
  887. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/compact_spec.rb +20 -0
  888. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/compare_by_spec.rb +38 -0
  889. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/custom_format_spec.rb +60 -0
  890. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/enum_spec.rb +43 -0
  891. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/executable_spec.rb +37 -0
  892. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/ssh_env_spec.rb +25 -0
  893. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/extname_spec.rb +18 -0
  894. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/temp_spec.rb +12 -0
  895. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb +52 -0
  896. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb +16 -0
  897. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb +212 -0
  898. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/local_time_zone_spec.rb +17 -0
  899. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb +45 -0
  900. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/abstract_spec.rb +25 -0
  901. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/class/self_included_modules_spec.rb +30 -0
  902. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerable/boolean_combinations_spec.rb +39 -0
  903. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb +26 -0
  904. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/stopped_spec.rb +32 -0
  905. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/options_consumer_spec.rb +17 -0
  906. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/hash/sym_keys_hash_spec.rb +13 -0
  907. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/compare_by_spec.rb +36 -0
  908. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/listable_spec.rb +13 -0
  909. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/simple_cache_spec.rb +13 -0
  910. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/speaker_spec.rb +13 -0
  911. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/call_if_proc_spec.rb +11 -0
  912. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/compact_spec.rb +20 -0
  913. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/if_present_spec.rb +13 -0
  914. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/template_spec_files/path/my_stub_with_template +1 -0
  915. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_sub_spec.rb +17 -0
  916. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/parent_n_spec.rb +33 -0
  917. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb +34 -0
  918. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb +65 -0
  919. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec/stubbed_module_a.rb +6 -0
  920. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec/stubbed_not_module.rb +6 -0
  921. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec.rb +19 -0
  922. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby_spec.rb +22 -0
  923. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +54 -0
  924. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +129 -0
  925. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/struct_spec.rb +57 -0
  926. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/yaml_spec.rb +75 -0
  927. data/sub/eac_ruby_utils/spec/locales/pt-BR.yml +55 -0
  928. data/sub/eac_ruby_utils/spec/rubocop_check_spec.rb +3 -0
  929. data/sub/eac_ruby_utils/spec/spec_helper.rb +15 -0
  930. data/sub/eac_templates/Gemfile +5 -0
  931. data/sub/eac_templates/eac_templates.gemspec +19 -0
  932. data/sub/eac_templates/lib/eac_templates/directory.rb +108 -0
  933. data/sub/eac_templates/lib/eac_templates/file.rb +48 -0
  934. data/sub/eac_templates/lib/eac_templates/patches/module/erb_template.rb +9 -0
  935. data/sub/eac_templates/lib/eac_templates/patches/module/template.rb +10 -0
  936. data/sub/eac_templates/lib/eac_templates/patches/module.rb +4 -0
  937. data/sub/eac_templates/lib/eac_templates/patches/object/erb_template.rb +9 -0
  938. data/sub/eac_templates/lib/eac_templates/patches/object/template.rb +9 -0
  939. data/sub/eac_templates/lib/eac_templates/patches/object.rb +4 -0
  940. data/sub/eac_templates/lib/eac_templates/patches.rb +4 -0
  941. data/sub/eac_templates/lib/eac_templates/searcher.rb +53 -0
  942. data/sub/eac_templates/lib/eac_templates/variable_not_found_error.rb +5 -0
  943. data/sub/eac_templates/lib/eac_templates/variable_providers/base.rb +21 -0
  944. data/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb +27 -0
  945. data/sub/eac_templates/lib/eac_templates/variable_providers/entries_reader.rb +23 -0
  946. data/sub/eac_templates/lib/eac_templates/variable_providers/generic.rb +23 -0
  947. data/sub/eac_templates/lib/eac_templates/variable_providers/hash.rb +27 -0
  948. data/sub/eac_templates/lib/eac_templates/variable_providers.rb +23 -0
  949. data/sub/eac_templates/lib/eac_templates/version.rb +5 -0
  950. data/sub/eac_templates/lib/eac_templates.rb +7 -0
  951. data/sub/eac_templates/spec/lib/eac_templates/file_spec.rb +35 -0
  952. data/sub/eac_templates/spec/lib/eac_templates/file_spec_files/expected_content +2 -0
  953. data/sub/eac_templates/spec/lib/eac_templates/file_spec_files/source.template +2 -0
  954. data/sub/eac_templates/spec/lib/eac_templates/searcher_spec.rb +30 -0
  955. data/sub/eac_templates/spec/lib/eac_templates/searcher_spec_files/path1/subdir1/file1.template +1 -0
  956. data/sub/eac_templates/spec/lib/eac_templates/searcher_spec_files/path1/subdir1/file2 +1 -0
  957. data/sub/eac_templates/spec/lib/eac_templates/searcher_spec_files/path2/subdir1/file3.template +1 -0
  958. data/sub/eac_templates/spec/lib/object/template_spec.rb +23 -0
  959. data/sub/eac_templates/spec/lib/object/template_spec_files/path/my_stub_with_template +1 -0
  960. data/sub/eac_templates/spec/rubocop_spec.rb +3 -0
  961. data/sub/eac_templates/spec/spec_helper.rb +4 -0
  962. metadata +976 -21
  963. data/lib/avm/tools/runner/eac_rails_base0.rb +0 -15
@@ -0,0 +1,1903 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ #
4
+ # Copyright 2013-2020 - Ingy döt Net <ingy@ingy.net>
5
+ #
6
+
7
+
8
+ # Exit on any errors:
9
+ set -e
10
+
11
+ export FILTER_BRANCH_SQUELCH_WARNING=1
12
+
13
+ # Import Bash+ helper functions:
14
+ SOURCE="$BASH_SOURCE"
15
+ while [[ -h $SOURCE ]]; do
16
+ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
17
+ SOURCE="$(readlink "$SOURCE")"
18
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
19
+ done
20
+ SOURCE_DIR="$(dirname "$SOURCE")"
21
+
22
+ if [[ -z "$GIT_SUBREPO_ROOT" ]]; then
23
+ # If `make install` installation used:
24
+ source "${SOURCE_DIR}/git-subrepo.d/bash+.bash"
25
+ else
26
+ # If `source .rc` method used:
27
+ source "${SOURCE_DIR}/../ext/bashplus/lib/bash+.bash"
28
+ fi
29
+ bash+:import :std can
30
+
31
+ VERSION=0.4.1
32
+ REQUIRED_GIT_VERSION=2.7.0
33
+ GIT_TMP="$(git rev-parse --git-common-dir 2> /dev/null || echo .git)/tmp"
34
+
35
+ # `git rev-parse` turns this into a getopt parser and a command usage message:
36
+ GETOPT_SPEC="\
37
+ git subrepo <command> <arguments> <options>
38
+
39
+ Commands:
40
+ clone Clone a remote repository into a local subdirectory
41
+ init Turn a current subdirectory into a subrepo
42
+ pull Pull upstream changes to the subrepo
43
+ push Push local subrepo changes upstream
44
+
45
+ fetch Fetch a subrepo's remote branch (and create a ref for it)
46
+ branch Create a branch containing the local subrepo commits
47
+ commit Commit a merged subrepo branch into the mainline
48
+
49
+ status Get status of a subrepo (or all of them)
50
+ clean Remove branches, remotes and refs for a subrepo
51
+ config Set subrepo configuration properties
52
+
53
+ help Documentation for git-subrepo (or specific command)
54
+ version Display git-subrepo version info
55
+ upgrade Upgrade the git-subrepo software itself
56
+
57
+ See 'git help subrepo' for complete documentation and usage of each command.
58
+
59
+ Options:
60
+ --
61
+ h Show the command summary
62
+ help Help overview
63
+ version Print the git-subrepo version number
64
+
65
+ a,all Perform command on all current subrepos
66
+ A,ALL Perform command on all subrepos and subsubrepos
67
+ b,branch= Specify the upstream branch to push/pull/fetch
68
+ e,edit Edit commit message
69
+ f,force Force certain operations
70
+ F,fetch Fetch the upstream content first
71
+ M,method= Method when you join, valid options are 'merge' or 'rebase'
72
+ Default is 'merge'
73
+ m,message= Specify a commit message
74
+ r,remote= Specify the upstream remote to push/pull/fetch
75
+ s,squash Squash commits on push
76
+ u,update Add the --branch and/or --remote overrides to .gitrepo
77
+
78
+ q,quiet Show minimal output
79
+ v,verbose Show verbose output
80
+ d,debug Show the actual commands used
81
+ x,DEBUG Turn on -x Bash debugging
82
+ "
83
+
84
+ #------------------------------------------------------------------------------
85
+ # Top level function:
86
+ #------------------------------------------------------------------------------
87
+ main() {
88
+ # Define global variables:
89
+ local command= # Subrepo subcommand to run
90
+ local command_arguments=() # Command args after getopt parsing
91
+ local commit_msg_args=() # Arguments to show in the commit msg
92
+ local subrepos=() # List of multiple subrepos
93
+
94
+ local all_wanted=false # Apply command to all subrepos
95
+ local ALL_wanted=false # Apply command to all subrepos and subsubrepos
96
+ local force_wanted=false # Force certain operations
97
+ local fetch_wanted=false # Fetch requested before a command
98
+ local squash_wanted=false # Squash commits on push
99
+ local update_wanted=false # Update .gitrepo with --branch and/or --remote
100
+
101
+ local quiet_wanted=false # Output should be quiet
102
+ local verbose_wanted=false # Output should be verbose
103
+ local debug_wanted=false # Show debug messages
104
+
105
+ local subdir= # Subdirectory of the subrepo being used
106
+ local subref= # Valid git ref format of subdir
107
+ local gitrepo= # Path to .gitrepo file
108
+ local worktree= # Worktree created by 'git worktree'
109
+ local start_pwd=$(pwd) # Store the original directory
110
+
111
+ local original_head_commit= # HEAD commit id at start of command
112
+ local original_head_branch= # HEAD ref at start of command
113
+ local upstream_head_commit= # HEAD commit id from a subrepo fetch
114
+
115
+ local subrepo_remote= # Remote url for subrepo's upstream repo
116
+ local subrepo_branch= # Upstream branch to clone/push/pull
117
+ local subrepo_commit= # Upstream HEAD from previous clone/pull
118
+ local subrepo_parent= # Local commit from before previous clone/pull
119
+ local subrepo_former= # A retired gitrepo key that might still exist
120
+
121
+ local refs_subrepo_branch= # A subrepo ref -> commit of branch/pull command
122
+ local refs_subrepo_commit= # A subrepo ref -> commit last merged
123
+ local refs_subrepo_fetch= # A subrepo ref -> FETCH_HEAD after fetch
124
+ local refs_subrepo_push= # A subrepo ref -> branch after push
125
+
126
+ local override_remote= # Remote specified with -r
127
+ local override_branch= # Remote specified with -b
128
+
129
+ local edit_wanted=false # Edit commit message using -e
130
+ local wanted_commit_message= # Custom commit message using -m
131
+
132
+ local join_method= # Current join method (rebase/merge)
133
+
134
+ local FAIL=true # Flag for RUN: fail on error
135
+ local OUT=false # Flag for RUN: put output in $output
136
+ local TTY=false # Flag for RUN: print output directly
137
+ local SAY=true # Flag for RUN: print command for verbose
138
+ local EXEC=false # Flag for RUN: run subprocess
139
+ local OK=true # Flag that commands have succeeded
140
+ local CODE=0 # Failure reason code
141
+ local INDENT= # Verbose indentation
142
+
143
+ local git_version= # Git version in use
144
+
145
+ # Check environment and parse CLI options:
146
+ assert-environment-ok
147
+
148
+ # Parse and validate command options:
149
+ get-command-options "$@"
150
+
151
+ # Make sure repo is in the proper state:
152
+ assert-repo-is-ready
153
+
154
+ command-init
155
+
156
+ if $all_wanted && [[ ! $command =~ ^(help|status)$ ]]; then
157
+ # Run the command on all subrepos
158
+ local args=( "${command_arguments[@]}" )
159
+ get-all-subrepos
160
+ for subdir in ${subrepos[*]}; do
161
+ command-prepare
162
+ subrepo_remote=
163
+ subrepo_branch=
164
+ command_arguments=( "$subdir" "${args[@]}" )
165
+ "command:$command"
166
+ done
167
+ else
168
+ # Run the command on a specific subrepo
169
+ command-prepare
170
+ "command:$command"
171
+ fi
172
+ }
173
+
174
+ #------------------------------------------------------------------------------
175
+ # API command functions.
176
+ #
177
+ # Most of these commands call a subrepo:$command function to do the actual
178
+ # work. The user facing output (via `say`) is done up here. The
179
+ # subrepo:* worker functions are meant to be called internally and don't print
180
+ # info to the user.
181
+ #------------------------------------------------------------------------------
182
+
183
+ # `git subrepo clone <url> [<subdir>]` command:
184
+ command:clone() {
185
+ command-setup +subrepo_remote subdir:guess-subdir
186
+
187
+ # Clone (or reclone) the subrepo into the subdir:
188
+ local reclone_up_to_date=false
189
+ subrepo:clone
190
+ if "$reclone_up_to_date"; then
191
+ say "Subrepo '$subdir' is up to date."
192
+ return
193
+ fi
194
+
195
+ # Successful command output:
196
+ local re=
197
+ $force_wanted && re=re
198
+ local remote="$subrepo_remote"
199
+ say "Subrepo '$remote' ($subrepo_branch) ${re}cloned into '$subdir'."
200
+ }
201
+
202
+ # `git subrepo init <subdir>` command:
203
+ command:init() {
204
+ command-setup +subdir
205
+ local remote="${subrepo_remote:=none}"
206
+ local branch="${subrepo_branch:=master}"
207
+
208
+ # Init new subrepo from the subdir:
209
+ subrepo:init
210
+ if OK; then
211
+ if [[ $remote == none ]]; then
212
+ say "Subrepo created from '$subdir' (with no remote)."
213
+ else
214
+ say "Subrepo created from '$subdir' with remote '$remote' ($branch)."
215
+ fi
216
+ else
217
+ die "Unknown init error code: '$CODE'"
218
+ fi
219
+ return 0
220
+ }
221
+
222
+ # `git subrepo pull <subdir>` command:
223
+ command:pull() {
224
+ command-setup +subdir
225
+
226
+ subrepo:pull
227
+ if OK; then
228
+ say "Subrepo '$subdir' pulled from '$subrepo_remote' ($subrepo_branch)."
229
+ elif [[ $CODE -eq -1 ]]; then
230
+ say "Subrepo '$subdir' is up to date."
231
+ elif [[ $CODE -eq 1 ]]; then
232
+ error-join
233
+ return "$CODE"
234
+ else
235
+ die "Unknown pull error code: '$CODE'"
236
+ fi
237
+ return 0
238
+ }
239
+
240
+ # `git subrepo push <subdir>` command:
241
+ command:push() {
242
+ local branch=
243
+ command-setup +subdir branch
244
+
245
+ subrepo:push
246
+ if OK; then
247
+ say "Subrepo '$subdir' pushed to '$subrepo_remote' ($subrepo_branch)."
248
+ elif [[ $CODE -eq -2 ]]; then
249
+ say "Subrepo '$subdir' has no new commits to push."
250
+ elif [[ $CODE -eq 1 ]]; then
251
+ error-join
252
+ return "$CODE"
253
+ else
254
+ die "Unknown push error code: '$CODE'"
255
+ fi
256
+ return 0
257
+ }
258
+
259
+ # `git subrepo fetch <subdir>` command
260
+ command:fetch() {
261
+ command-setup +subdir
262
+ if [[ $subrepo_remote == "none" ]]; then
263
+ say "Ignored '$subdir', no remote."
264
+ else
265
+ subrepo:fetch
266
+ say "Fetched '$subdir' from '$subrepo_remote' ($subrepo_branch)."
267
+ fi
268
+ }
269
+
270
+ # `git subrepo branch <subdir>` command:
271
+ command:branch() {
272
+ command-setup +subdir
273
+ if $fetch_wanted; then
274
+ CALL subrepo:fetch
275
+ fi
276
+
277
+ local branch="subrepo/$subref"
278
+ if $force_wanted; then
279
+ # We must make sure that the worktree is removed as well
280
+ worktree="$GIT_TMP/$branch"
281
+ git:delete-branch "$branch"
282
+ fi
283
+
284
+ if git:branch-exists "$branch"; then
285
+ error "Branch '$branch' already exists. Use '--force' to override."
286
+ fi
287
+
288
+ # Create the subrepo branch:
289
+ subrepo:branch
290
+
291
+ say "Created branch '$branch' and worktree '$worktree'."
292
+ }
293
+
294
+ # `git subrepo commit <subdir>` command
295
+ command:commit() {
296
+ command-setup +subdir subrepo_commit_ref
297
+
298
+ if "$fetch_wanted"; then
299
+ CALL subrepo:fetch
300
+ fi
301
+ git:rev-exists "$refs_subrepo_fetch" ||
302
+ error "Can't find ref '$refs_subrepo_fetch'. Try using -F."
303
+ upstream_head_commit="$(git rev-parse "$refs_subrepo_fetch")"
304
+
305
+ [[ -n $subrepo_commit_ref ]] ||
306
+ subrepo_commit_ref="subrepo/$subref"
307
+ subrepo:commit
308
+
309
+ say "Subrepo commit '$subrepo_commit_ref' committed as"
310
+ say "subdir '$subdir/' to branch '$original_head_branch'."
311
+ }
312
+
313
+ # `git subrepo status [<subdir>]` command:
314
+ command:status() {
315
+ subrepo:status | ${GIT_SUBREPO_PAGER}
316
+ }
317
+
318
+ status-refs() {
319
+ local output=
320
+ while read line; do
321
+ [[ $line =~ ^([0-9a-f]+)\ refs/subrepo/$subref/([a-z]+) ]] || continue
322
+ local sha1=; sha1="$(git rev-parse --short "${BASH_REMATCH[1]}")"
323
+ local type="${BASH_REMATCH[2]}"
324
+ local ref="refs/subrepo/$subref/$type"
325
+ if [[ $type == branch ]]; then
326
+ output+=" Branch Ref: $sha1 ($ref)"$'\n'
327
+ elif [[ $type == commit ]]; then
328
+ output+=" Commit Ref: $sha1 ($ref)"$'\n'
329
+ elif [[ $type == fetch ]]; then
330
+ output+=" Fetch Ref: $sha1 ($ref)"$'\n'
331
+ elif [[ $type == pull ]]; then
332
+ output+=" Pull Ref: $sha1 ($ref)"$'\n'
333
+ elif [[ $type == push ]]; then
334
+ output+=" Push Ref: $sha1 ($ref)"$'\n'
335
+ fi
336
+ done < <(git show-ref)
337
+ if [[ -n $output ]]; then
338
+ printf " Refs:\n$output"
339
+ fi
340
+ }
341
+
342
+ # `git subrepo clean <subdir>` command
343
+ command:clean() {
344
+ command-setup +subdir
345
+ local clean_list=()
346
+ subrepo:clean
347
+ for item in "${clean_list[@]}"; do
348
+ say "Removed $item."
349
+ done
350
+ }
351
+
352
+ # Wrap git config $gitrepo
353
+ command:config() {
354
+ command-setup +subdir +config_option config_value
355
+ o "Update '$subdir' configuration with $config_option=$config_value"
356
+
357
+ if [[ ! $config_option =~ ^(branch|cmdver|commit|method|remote|version)$ ]]; then
358
+ error "Option $config_option not recognized"
359
+ fi
360
+
361
+ if [[ -z $config_value ]]; then
362
+ OUT=true RUN git config --file="$gitrepo" "subrepo.$config_option"
363
+ say "Subrepo '$subdir' option '$config_option' has value '$output'."
364
+ return
365
+ fi
366
+
367
+ if ! $force_wanted; then
368
+ # Only allow changing method without force
369
+ if [[ ! $config_option == "method" ]]; then
370
+ error "This option is autogenerated, use '--force' to override."
371
+ fi
372
+ fi
373
+
374
+ if [[ $config_option == "method" ]]; then
375
+ if [[ ! $config_value =~ ^(merge|rebase)$ ]]; then
376
+ error "Not a valid method. Valid options are 'merge' or 'rebase'."
377
+ fi
378
+ fi
379
+
380
+ RUN git config --file="$gitrepo" "subrepo.$config_option" "$config_value"
381
+ say "Subrepo '$subdir' option '$config_option' set to '$config_value'."
382
+ }
383
+
384
+
385
+ # Launch the manpage viewer:
386
+ command:help() {
387
+ source "${SOURCE_DIR}/git-subrepo.d/help-functions.bash"
388
+ local cmd="${command_arguments[0]}"
389
+ if [[ -n $cmd ]]; then
390
+ if can "help:$cmd"; then
391
+ "help:$cmd"
392
+ echo
393
+ else
394
+ err "No help found for '$cmd'"
395
+ fi
396
+ elif $all_wanted; then
397
+ help:all
398
+ else
399
+ exec git help subrepo
400
+ fi
401
+ msg_ok=0
402
+ }
403
+
404
+ # Print version info.
405
+ # TODO: Add short commit id after version.
406
+ # Will need to get it from repo or make install can put it somewhere.
407
+ command:version() {
408
+ cat <<...
409
+ git-subrepo Version: $VERSION
410
+ Copyright 2013-2020 Ingy döt Net
411
+ https://github.com/ingydotnet/git-subrepo
412
+ $BASH_SOURCE
413
+ Git Version: $git_version
414
+
415
+ ...
416
+ :
417
+ }
418
+
419
+ command:upgrade() {
420
+ local path="$0"
421
+ if [[ $path =~ ^/ && $path =~ ^(.*/git-subrepo)/lib/git-subrepo$ ]]; then
422
+ local subrepo_root="${BASH_REMATCH[1]}"
423
+ (
424
+ o "Change directory to '$subrepo_root'."
425
+ cd "${BASH_REMATCH[1]}"
426
+
427
+ local branch="$(git rev-parse --abbrev-ref HEAD)"
428
+ if [[ $branch != master ]]; then
429
+ error "git-subrepo repo is not on the 'master' branch"
430
+ fi
431
+
432
+ o "'git pull' latest version."
433
+ RUN git pull --ff-only
434
+
435
+ say "git-subrepo is up to date."
436
+ )
437
+ else
438
+ die "\
439
+
440
+ Sorry. Your installation can't use the 'git subrepo upgrade' command. The
441
+ command only works if you installed git subrepo by adding
442
+ '/path/to/git-subrepo' to your PATH.
443
+
444
+ If you used 'make install' to install git-subrepo, then just do this:
445
+
446
+ cd /path/to/git-subrepo
447
+ git pull
448
+ make install
449
+
450
+ "
451
+ fi
452
+ }
453
+
454
+ #------------------------------------------------------------------------------
455
+ # Subrepo command worker functions.
456
+ #------------------------------------------------------------------------------
457
+
458
+ # Clone by fetching remote content into our subdir:
459
+ subrepo:clone() {
460
+ re="$1"
461
+
462
+ FAIL=false RUN git rev-parse HEAD
463
+ if ! OK; then
464
+ error "You can't clone into an empty repository"
465
+ fi
466
+
467
+ # Turn off force unless really a reclone:
468
+ if $force_wanted && [[ ! -f $gitrepo ]]; then
469
+ force_wanted=false
470
+ fi
471
+
472
+ if $force_wanted; then
473
+ o "--force indicates a reclone."
474
+ CALL subrepo:fetch
475
+ read-gitrepo-file
476
+ o "Check if we already are up to date."
477
+ if [[ $upstream_head_commit == $subrepo_commit ]]; then
478
+ reclone_up_to_date=true
479
+ return
480
+ fi
481
+ o "Remove the old subdir."
482
+ RUN git rm -r -- "$subdir"
483
+ else
484
+ assert-subdir-empty
485
+ if [[ -z $subrepo_branch ]]; then
486
+ o "Determine the upstream head branch."
487
+ get-upstream-head-branch
488
+ subrepo_branch="$output"
489
+ fi
490
+
491
+ CALL subrepo:fetch
492
+ fi
493
+
494
+ o "Make the directory '$subdir/' for the clone."
495
+ RUN mkdir -p -- "$subdir"
496
+
497
+ o "Commit the new '$subdir/' content."
498
+ subrepo_commit_ref="$upstream_head_commit"
499
+ CALL subrepo:commit
500
+ }
501
+
502
+ # Init a new subrepo from current repo:
503
+ subrepo:init() {
504
+ local branch_name="subrepo/${subref:??}"
505
+ # Check if subdir is proper candidate for this init:
506
+ assert-subdir-ready-for-init
507
+
508
+ o "Put info into '$subdir/.gitrepo' file."
509
+ update-gitrepo-file
510
+
511
+ o "Add the new '$subdir/.gitrepo' file."
512
+ # -f from pull request #219. TODO needs test.
513
+ RUN git add -f -- "$gitrepo"
514
+
515
+ o "Commit new subrepo to the '$original_head_branch' branch."
516
+ subrepo_commit_ref="$original_head_commit"
517
+ RUN git commit -m "$(get-commit-message)"
518
+
519
+ o "Create ref '$refs_subrepo_commit'."
520
+ git:make-ref "$refs_subrepo_commit" "$subrepo_commit_ref"
521
+ }
522
+
523
+ # Properly merge a local subrepo branch with upstream and commit to mainline:
524
+ subrepo:pull() {
525
+ CALL subrepo:fetch
526
+
527
+ # Check if we already are up to date
528
+ # If the -u flag is present, always perform the operation
529
+ if [[ $upstream_head_commit == $subrepo_commit ]] && ! $update_wanted; then
530
+ OK=false; CODE=-1; return
531
+ fi
532
+
533
+ local branch_name="subrepo/$subref"
534
+ git:delete-branch "$branch_name"
535
+
536
+ subrepo_commit_ref="$branch_name"
537
+
538
+ o "Create subrepo branch '$branch_name'."
539
+ CALL subrepo:branch
540
+ cd "$worktree";
541
+
542
+ if [[ "$join_method" == "rebase" ]]; then
543
+ o "Rebase changes to $refs_subrepo_fetch"
544
+ FAIL=false OUT=true RUN git rebase "$refs_subrepo_fetch" "$branch_name"
545
+ if ! OK; then
546
+ say "The \"git rebase\" command failed:"
547
+ say
548
+ say " ${output//$'\n'/$'\n' }"
549
+ CODE=1
550
+ return
551
+ fi
552
+ else
553
+ o "Merge in changes from $refs_subrepo_fetch"
554
+ FAIL=false RUN git merge "$refs_subrepo_fetch"
555
+ if ! OK; then
556
+ say "The \"git merge\" command failed:"
557
+ say
558
+ say " ${output//$'\n'/$'\n' }"
559
+ CODE=1
560
+ return
561
+ fi
562
+ fi
563
+
564
+ o "Back to $start_pwd"
565
+ cd "$start_pwd";
566
+
567
+ o "Create ref '$refs_subrepo_branch' for branch '$branch_name'."
568
+ git:make-ref "$refs_subrepo_branch" "$branch_name"
569
+
570
+ o "Commit the new '$subrepo_commit_ref' content."
571
+ CALL subrepo:commit
572
+ }
573
+
574
+ # Push a properly merged subrepo branch upstream:
575
+ subrepo:push() {
576
+ local branch_name="$branch"
577
+ local new_upstream=false
578
+ local branch_created=false
579
+
580
+ if [[ -z $branch_name ]]; then
581
+ FAIL=false OUT=false CALL subrepo:fetch
582
+
583
+ if ! OK; then
584
+ # Check if we are pushing to a new upstream repo (or branch) and just
585
+ # push the commit directly. This is common after a `git subrepo init`:
586
+ # Force to case in
587
+ local re="(^|"$'\n'")fatal: couldn't find remote ref "
588
+ if [[ ${output,,} =~ $re ]]; then
589
+ o "Pushing to new upstream: $subrepo_remote ($subrepo_branch)."
590
+ new_upstream=true
591
+ else
592
+ error "Fetch for push failed: $output"
593
+ fi
594
+ else
595
+ # Check that we are up to date:
596
+ o "Check upstream head against .gitrepo commit."
597
+ if ! $force_wanted; then
598
+ if [[ $upstream_head_commit != $subrepo_commit ]]; then
599
+ error "There are new changes upstream, you need to pull first."
600
+ fi
601
+ fi
602
+ fi
603
+
604
+ branch_name="subrepo/$subref"
605
+ git:delete-branch "$branch_name"
606
+
607
+ if $squash_wanted; then
608
+ o "Squash commits"
609
+ subrepo_parent="HEAD^"
610
+ fi
611
+
612
+ o "Create subrepo branch '$branch_name'."
613
+ CALL subrepo:branch "$branch_name"
614
+ cd "$worktree";
615
+
616
+ if [[ "$join_method" == "rebase" ]]; then
617
+ o "Rebase changes to $refs_subrepo_fetch"
618
+ FAIL=false OUT=true RUN git rebase "$refs_subrepo_fetch" "$branch_name"
619
+ if ! OK; then
620
+ say "The \"git rebase\" command failed:"
621
+ say
622
+ say " ${output//$'\n'/$'\n' }"
623
+ CODE=1
624
+ return
625
+ fi
626
+ fi
627
+ branch_created=true
628
+ cd "$start_pwd"
629
+ else
630
+ if $squash_wanted; then
631
+ error "Squash option (-s) can't be used with branch parameter"
632
+ fi
633
+ fi
634
+
635
+ o "Make sure that '$branch_name' exists."
636
+ git:branch-exists "$branch_name" ||
637
+ error "No subrepo branch '$branch_name' to push."
638
+
639
+ o "Check if we have something to push"
640
+ new_upstream_head_commit="$(git rev-parse "$branch_name")"
641
+ if ! $new_upstream; then
642
+ if [[ $upstream_head_commit == $new_upstream_head_commit ]]; then
643
+ OK=false
644
+ CODE=-2
645
+ return
646
+ fi
647
+ fi
648
+
649
+ if ! $force_wanted; then
650
+ o "Make sure '$branch_name' contains the '$refs_subrepo_fetch' HEAD."
651
+ if ! git:commit-in-rev-list "$upstream_head_commit" "$branch_name"; then
652
+ error "Can't commit: '$branch_name' doesn't contain upstream HEAD: " \
653
+ "$upstream_head_commit"
654
+ fi
655
+ fi
656
+
657
+ local force=''
658
+ "$force_wanted" && force=' --force'
659
+
660
+ o "Push$force branch '$branch_name' to '$subrepo_remote' ($subrepo_branch)."
661
+ RUN git push$force "$subrepo_remote" "$branch_name":"$subrepo_branch"
662
+
663
+ o "Create ref '$refs_subrepo_push' for branch '$branch_name'."
664
+ git:make-ref "$refs_subrepo_push" "$branch_name"
665
+
666
+ if $branch_created; then
667
+ o "Remove branch '$branch_name'."
668
+ git:delete-branch "$branch_name"
669
+ fi
670
+
671
+ o "Put updates into '$subdir/.gitrepo' file."
672
+ upstream_head_commit="$new_upstream_head_commit"
673
+ subrepo_commit_ref="$upstream_head_commit"
674
+ update-gitrepo-file
675
+ RUN git commit -m "$(get-commit-message)"
676
+ }
677
+
678
+ # Fetch the subrepo's remote branch content:
679
+ subrepo:fetch() {
680
+ if [[ $subrepo_remote == none ]]; then
681
+ error "Can't fetch subrepo. Remote is 'none' in '$subdir/.gitrepo'."
682
+ fi
683
+
684
+ o "Fetch the upstream: $subrepo_remote ($subrepo_branch)."
685
+ RUN git fetch --no-tags --quiet "$subrepo_remote" "$subrepo_branch"
686
+ OK || return
687
+
688
+ o "Get the upstream subrepo HEAD commit."
689
+ OUT=true RUN git rev-parse FETCH_HEAD^0
690
+ upstream_head_commit="$output"
691
+
692
+ o "Create ref '$refs_subrepo_fetch'."
693
+ git:make-ref "$refs_subrepo_fetch" FETCH_HEAD^0
694
+ }
695
+
696
+ # Create a subrepo branch containing all changes
697
+ subrepo:branch() {
698
+ local branch="${1:-"subrepo/$subref"}"
699
+ o "Check if the '$branch' branch already exists."
700
+ git:branch-exists "$branch" && return
701
+
702
+ local last_gitrepo_commit=
703
+ local first_gitrepo_commit=
704
+
705
+ o "Subrepo parent: $subrepo_parent"
706
+ if [[ -n "$subrepo_parent" ]]; then
707
+ local prev_commit=
708
+ local ancestor=
709
+ o "Create new commits with parents into the subrepo fetch"
710
+ OUT=true RUN git rev-list --reverse --ancestry-path --topo-order "$subrepo_parent..HEAD"
711
+ local commit_list="$output"
712
+ for commit in $commit_list; do
713
+ o "Working on $commit"
714
+
715
+ FAIL=false OUT=true RUN git config --blob \
716
+ "$commit":"$subdir/.gitrepo" "subrepo.commit"
717
+ if [[ -z "$output" ]]; then
718
+ o "Ignore commit, no .gitrepo file"
719
+ continue
720
+ fi
721
+
722
+ local gitrepo_commit="$output"
723
+ o ".gitrepo reference commit: $gitrepo_commit"
724
+
725
+
726
+ # Only include the commit if it's a child of the previous commit
727
+ # This way we create a single path between $subrepo_parent..HEAD
728
+ if [[ -n "$ancestor" ]]; then
729
+ local is_direct_child=$(git show -s --pretty=format:"%P" $commit | grep "$ancestor")
730
+ o "is child: $is_direct_child"
731
+ if [[ -z "$is_direct_child" ]]; then
732
+ o "Ignore $commit, it's not in the selected path"
733
+ continue
734
+ fi
735
+ fi
736
+
737
+ # Remember the previous commit from the parent repo path
738
+ ancestor="$commit"
739
+
740
+ o "Check for rebase"
741
+ if git:rev-exists "$refs_subrepo_fetch"; then
742
+ if ! git:commit-in-rev-list "$gitrepo_commit" "$refs_subrepo_fetch"; then
743
+ error "Local repository does not contain $gitrepo_commit. Try to 'git subrepo fetch $subref' or add the '-F' flag to always fetch the latest content."
744
+ fi
745
+ fi
746
+
747
+ o "Find parents"
748
+ local first_parent=
749
+ [[ -n $prev_commit ]] && first_parent="-p $prev_commit"
750
+ local second_parent=
751
+ if [[ -z "$first_gitrepo_commit" ]]; then
752
+ first_gitrepo_commit="$gitrepo_commit"
753
+ second_parent="-p $gitrepo_commit"
754
+ fi
755
+
756
+ if [[ "$join_method" != "rebase" ]]; then
757
+ # In the rebase case we don't create merge commits
758
+ if [[ "$gitrepo_commit" != "$last_gitrepo_commit" ]]; then
759
+ second_parent="-p $gitrepo_commit"
760
+ last_gitrepo_commit="$gitrepo_commit"
761
+ fi
762
+ fi
763
+
764
+ o "Create a new commit $first_parent $second_parent"
765
+ FAIL=false RUN git cat-file -e "$commit":"$subdir"
766
+ if OK; then
767
+ o "Create with content"
768
+ local PREVIOUS_IFS=$IFS
769
+ IFS=$'\n'
770
+ local author_info=( $(git log -1 --date=default --format=%ad%n%ae%n%an "$commit") )
771
+ local commiter_info=( $(git log -1 --date=default --format=%cd%n%ce%n%cn "$commit") )
772
+ IFS=$PREVIOUS_IFS
773
+
774
+ # When we create new commits we leave the author information unchanged
775
+ # the committer will though be updated to the current user
776
+ # This should be analog how cherrypicking is handled allowing git
777
+ # to store both the original author but also the responsible committer
778
+ # that created the local version of the commit and pushed it.
779
+ prev_commit=$(git log -n 1 --date=default --format=%B "$commit" |
780
+ GIT_AUTHOR_DATE="${author_info[0]}" \
781
+ GIT_AUTHOR_EMAIL="${author_info[1]}" \
782
+ GIT_AUTHOR_NAME="${author_info[2]}" \
783
+ GIT_COMMITTER_DATE="${commiter_info[0]}" \
784
+ GIT_COMMITTER_EMAIL="${commiter_info[1]}" \
785
+ GIT_COMMITTER_NAME="${commiter_info[2]}" \
786
+ git commit-tree -F - $first_parent $second_parent "$commit":"$subdir")
787
+ else
788
+ o "Create empty placeholder"
789
+ prev_commit=$(git commit-tree -m "EMPTY" \
790
+ $first_parent $second_parent "4b825dc642cb6eb9a060e54bf8d69288fbee4904")
791
+ fi
792
+ done
793
+
794
+ o "Create branch '$branch' for this new commit set $prev_commit."
795
+ RUN git branch "$branch" "$prev_commit"
796
+ else
797
+ o "No parent setting, use the subdir content."
798
+ RUN git branch "$branch" HEAD
799
+ TTY=true FAIL=false RUN git filter-branch -f --subdirectory-filter \
800
+ "$subref" "$branch"
801
+ fi
802
+
803
+ o "Remove the .gitrepo file from $first_gitrepo_commit..$branch"
804
+ local filter="$branch"
805
+ [[ -n "$first_gitrepo_commit" ]] && filter="$first_gitrepo_commit..$branch"
806
+ FAIL=false RUN git filter-branch -f --prune-empty --tree-filter \
807
+ "rm -f .gitrepo" "$filter"
808
+
809
+ git:create-worktree "$branch"
810
+
811
+ o "Create ref '$refs_subrepo_branch'."
812
+ git:make-ref "$refs_subrepo_branch" "$branch"
813
+ }
814
+
815
+ # Commit a merged subrepo branch:
816
+ subrepo:commit() {
817
+ o "Check that '$subrepo_commit_ref' exists."
818
+ git:rev-exists "$subrepo_commit_ref" ||
819
+ error "Commit ref '$subrepo_commit_ref' does not exist."
820
+
821
+ if ! "$force_wanted"; then
822
+ local upstream="$upstream_head_commit"
823
+ o "Make sure '$subrepo_commit_ref' contains the upstream HEAD."
824
+ if ! git:commit-in-rev-list "$upstream" "$subrepo_commit_ref"; then
825
+ error \
826
+ "Can't commit: '$subrepo_commit_ref' doesn't contain upstream HEAD."
827
+ fi
828
+ fi
829
+
830
+ if git ls-files -- "$subdir" | grep -q .; then
831
+ o "Remove old content of the subdir."
832
+ RUN git rm -r -- "$subdir"
833
+ fi
834
+
835
+ o "Put remote subrepo content into '$subdir/'."
836
+ RUN git read-tree --prefix="$subdir" -u "$subrepo_commit_ref"
837
+
838
+ o "Put info into '$subdir/.gitrepo' file."
839
+ update-gitrepo-file
840
+ RUN git add -f -- "$gitrepo"
841
+
842
+ local commit_message
843
+ if [[ -n "$wanted_commit_message" ]]; then
844
+ commit_message="$wanted_commit_message"
845
+ else
846
+ commit_message="$(get-commit-message)"
847
+ fi
848
+
849
+ local edit_flag=
850
+ $edit_wanted && edit_flag=--edit
851
+
852
+ [[ -n $commit_message ]] || commit_message="$(get-commit-message)"
853
+
854
+ local edit_flag=
855
+ $edit_wanted && edit_flag=--edit
856
+
857
+ o "Commit to the '$original_head_branch' branch."
858
+ if [[ $original_head_commit != none ]]; then
859
+ RUN git commit $edit_flag -m "$commit_message"
860
+ else
861
+ # We had cloned into an empty repo, side effect of prior git reset --mixed
862
+ # command is that subrepo's history is now part of the index. Commit
863
+ # without that history.
864
+ OUT=true RUN git write-tree
865
+ OUT=true RUN git commit-tree $edit_flag -m "$commit_message" "$output"
866
+ RUN git reset --hard "$output"
867
+ fi
868
+
869
+ # Clean up worktree to indicate that we are ready
870
+ git:remove-worktree
871
+
872
+ o "Create ref '$refs_subrepo_commit'."
873
+ git:make-ref "$refs_subrepo_commit" "$subrepo_commit_ref"
874
+ }
875
+
876
+ subrepo:status() {
877
+ if [[ ${#command_arguments[@]} -eq 0 ]]; then
878
+ get-all-subrepos
879
+ local count=${#subrepos[@]}
880
+ if ! "$quiet_wanted"; then
881
+ if [[ $count -eq 0 ]]; then
882
+ echo "No subrepos."
883
+ return
884
+ else
885
+ local s=; [[ $count -eq 1 ]] || s=s
886
+ echo "$count subrepo$s:"
887
+ echo
888
+ fi
889
+ fi
890
+ else
891
+ subrepos=("${command_arguments[@]}")
892
+ fi
893
+
894
+ for subdir in "${subrepos[@]}"; do
895
+ check-and-normalize-subdir
896
+ encode-subdir
897
+
898
+ if [[ ! -f $subdir/.gitrepo ]]; then
899
+ echo "'$subdir' is not a subrepo"
900
+ echo
901
+ continue
902
+ fi
903
+
904
+ refs_subrepo_fetch="refs/subrepo/$subref/fetch"
905
+ upstream_head_commit="$(
906
+ git rev-parse --short "$refs_subrepo_fetch" 2> /dev/null || true
907
+ )"
908
+ subrepo_remote=
909
+ subrepo_branch=
910
+
911
+ read-gitrepo-file
912
+ if $fetch_wanted; then
913
+ subrepo:fetch
914
+ fi
915
+
916
+ if $quiet_wanted; then
917
+ echo "$subdir"
918
+ continue
919
+ fi
920
+
921
+ echo "Git subrepo '$subdir':"
922
+ git:branch-exists "subrepo/$subref" &&
923
+ echo " Subrepo Branch: subrepo/$subref"
924
+ local remote="subrepo/$subref"
925
+ FAIL=false OUT=true RUN git config "remote.$remote.url"
926
+ [[ -n $output ]] &&
927
+ echo " Remote Name: subrepo/$subref"
928
+ echo " Remote URL: $subrepo_remote"
929
+ [[ -n $upstream_head_commit ]] &&
930
+ echo " Upstream Ref: $upstream_head_commit"
931
+ echo " Tracking Branch: $subrepo_branch"
932
+ [[ -z $subrepo_commit ]] ||
933
+ echo " Pulled Commit: $(git rev-parse --short $subrepo_commit)"
934
+ if [[ -n $subrepo_parent ]]; then
935
+ echo " Pull Parent: $(git rev-parse --short $subrepo_parent)"
936
+ # TODO Remove this eventually:
937
+ elif [[ -n $subrepo_former ]]; then
938
+ printf " Former Commit: $(git rev-parse --short $subrepo_former)"
939
+ echo " *** DEPRECATED ***"
940
+ fi
941
+
942
+ # Grep for directory, branch can be in detached state due to conflicts
943
+ local _worktree=$(git worktree list | grep "$GIT_TMP/subrepo/$subdir")
944
+ if [[ -n $_worktree ]]; then
945
+ echo " Worktree: $_worktree"
946
+ fi
947
+
948
+ if "$verbose_wanted"; then
949
+ status-refs
950
+ fi
951
+
952
+ echo
953
+ done
954
+ }
955
+
956
+ subrepo:clean() {
957
+ # Remove subrepo branches if exist:
958
+ local branch="subrepo/$subref"
959
+ local ref="refs/heads/$branch"
960
+ local worktree="$GIT_TMP/$branch"
961
+
962
+ o "Clean $subdir"
963
+ git:remove-worktree
964
+ if git:branch-exists "$branch"; then
965
+ o "Remove branch '$branch'."
966
+ RUN git update-ref -d "$ref"
967
+ clean_list+=("branch '$branch'")
968
+ fi
969
+
970
+ if "$force_wanted"; then
971
+ o "Remove all subrepo refs."
972
+ local suffix=""
973
+ if ! $all_wanted; then
974
+ suffix="$subref/"
975
+ fi
976
+ git show-ref | while read hash ref; do
977
+ if [[ "$ref" == refs/subrepo/$suffix* ]]; then
978
+ git update-ref -d "$ref"
979
+ fi
980
+ done
981
+ fi
982
+ }
983
+
984
+ #------------------------------------------------------------------------------
985
+ # Support functions:
986
+ #------------------------------------------------------------------------------
987
+
988
+
989
+ # TODO:
990
+ # Collect original options and arguments into an array for commit message
991
+ # They should be normalized and pruned
992
+
993
+ # Parse command line options:
994
+ get-command-options() {
995
+ [[ $# -eq 0 ]] && set -- --help
996
+
997
+ [[ -n $GIT_SUBREPO_QUIET ]] && quiet_wanted=true
998
+ [[ -n $GIT_SUBREPO_VERBOSE ]] && verbose_wanted=true
999
+ [[ -n $GIT_SUBREPO_DEBUG ]] && debug_wanted=true
1000
+
1001
+ eval "$(
1002
+ echo "$GETOPT_SPEC" |
1003
+ git rev-parse --parseopt -- "$@" ||
1004
+ echo exit $?
1005
+ )"
1006
+
1007
+ while [[ $# -gt 0 ]]; do
1008
+ local option="$1"; shift
1009
+ case "$option" in
1010
+ --) break ;;
1011
+ -a) all_wanted=true ;;
1012
+ -A) ALL_wanted=true
1013
+ all_wanted=true ;;
1014
+ -b) subrepo_branch="$1"
1015
+ override_branch="$1"
1016
+ commit_msg_args+=("--branch=$1")
1017
+ shift ;;
1018
+ -e) edit_wanted=true ;;
1019
+ -f) force_wanted=true
1020
+ commit_msg_args+=("--force") ;;
1021
+ -F) fetch_wanted=true ;;
1022
+ -m) wanted_commit_message="$1"
1023
+ shift;;
1024
+ -M) join_method="$1"
1025
+ shift;;
1026
+ -M) join_method="$1"
1027
+ shift;;
1028
+ -r) subrepo_remote="$1"
1029
+ override_remote="$1"
1030
+ commit_msg_args+=("--remote=$1")
1031
+ shift ;;
1032
+ -s) squash_wanted=true ;;
1033
+ -u) update_wanted=true
1034
+ commit_msg_args+=("--update") ;;
1035
+ -q) quiet_wanted=true ;;
1036
+ -v) verbose_wanted=true ;;
1037
+ -d) debug_wanted=true ;;
1038
+ -x) set -x ;;
1039
+ --version)
1040
+ echo "$VERSION"
1041
+ exit ;;
1042
+ *) usage-error "Unexpected option: '$option'." ;;
1043
+ esac
1044
+ done
1045
+
1046
+ # Set subrepo command:
1047
+ command="$1"; shift
1048
+
1049
+ # Make sure command exists:
1050
+ can "command:$command" ||
1051
+ usage-error "'$command' is not a command. See 'git subrepo help'."
1052
+
1053
+ command_arguments=("$@")
1054
+ if [[ ${#command_arguments} -gt 0 ]]; then
1055
+ local first="${command_arguments[0]}"
1056
+ first="${first%/}"
1057
+ command_arguments[0]="$first"
1058
+ fi
1059
+ commit_msg_args+=("${command_arguments[@]}")
1060
+
1061
+ for option in all ALL edit fetch force squash; do
1062
+ var="${option}_wanted"
1063
+ if ${!var}; then
1064
+ check_option $option
1065
+ fi
1066
+ done
1067
+
1068
+ if [[ -n $override_branch ]]; then
1069
+ check_option branch
1070
+ fi
1071
+ if [[ -n $override_remote ]]; then
1072
+ check_option remote
1073
+ fi
1074
+ if [[ -n $wanted_commit_message ]]; then
1075
+ check_option message
1076
+ fi
1077
+ if $update_wanted; then
1078
+ check_option update
1079
+ if [[ -z $subrepo_branch && -z $subrepo_remote ]]; then
1080
+ usage-error "Can't use '--update' without '--branch' or '--remote'."
1081
+ fi
1082
+ fi
1083
+ }
1084
+
1085
+ options_help='all'
1086
+ options_branch='all fetch force'
1087
+ options_clean='ALL all force'
1088
+ options_clone='branch edit force message method'
1089
+ options_config='force'
1090
+ options_commit='edit fetch force message'
1091
+ options_fetch='all branch remote'
1092
+ options_init='branch remote method'
1093
+ options_pull='all branch edit force message remote update'
1094
+ options_push='all branch force remote squash update'
1095
+ options_status='ALL all fetch'
1096
+ check_option() {
1097
+ local var="options_${command//-/_}"
1098
+ [[ ${!var} =~ $1 ]] ||
1099
+ usage-error "Invalid option '--$1' for '$command'."
1100
+ }
1101
+
1102
+ #------------------------------------------------------------------------------
1103
+ # Command argument validation:
1104
+ #------------------------------------------------------------------------------
1105
+
1106
+ command-init() {
1107
+ # Export variable to let other processes (possibly git hooks) know that they
1108
+ # are running under git-subrepo. Set to current process pid, so it can be
1109
+ # further verified if need be:
1110
+ export GIT_SUBREPO_RUNNING="$$"
1111
+ export GIT_SUBREPO_COMMAND="$command"
1112
+
1113
+ : "${GIT_SUBREPO_PAGER:=${PAGER:-less}}"
1114
+ if [[ $GIT_SUBREPO_PAGER == less ]]; then
1115
+ GIT_SUBREPO_PAGER='less -FRX'
1116
+ fi
1117
+ }
1118
+
1119
+ command-prepare() {
1120
+ local output=
1121
+ if git:rev-exists HEAD; then
1122
+ git:get-head-branch-commit
1123
+ fi
1124
+ original_head_commit="${output:-none}"
1125
+ }
1126
+
1127
+ # Do the setup steps needed by most of the subrepo subcommands:
1128
+ command-setup() {
1129
+ get-params "$@"
1130
+
1131
+ check-and-normalize-subdir
1132
+ encode-subdir
1133
+ gitrepo="$subdir/.gitrepo"
1134
+
1135
+ if ! $force_wanted; then
1136
+ o "Check for worktree with branch subrepo/$subdir"
1137
+ local _worktree=$(git worktree list | grep "\[subrepo/$subdir\]" | cut -d ' ' -f1)
1138
+ if [[ $command =~ ^(commit)$ && -z $_worktree ]]; then
1139
+ error "There is no worktree available, use the branch command first"
1140
+ elif [[ ! $command =~ ^(branch|clean|commit|push)$ && -n $_worktree ]]; then
1141
+ if [[ -e $gitrepo ]]; then
1142
+ error "There is already a worktree with branch subrepo/$subdir.
1143
+ Use the --force flag to override this check or perform a subrepo clean
1144
+ to remove the worktree."
1145
+ else
1146
+ error "There is already a worktree with branch subrepo/$subdir.
1147
+ Use the --force flag to override this check or remove the worktree with
1148
+ 1. rm -rf $_worktree
1149
+ 2. git worktree prune
1150
+ "
1151
+ fi
1152
+ fi
1153
+ fi
1154
+
1155
+ # Set refs_ variables:
1156
+ refs_subrepo_branch="refs/subrepo/$subref/branch"
1157
+ refs_subrepo_commit="refs/subrepo/$subref/commit"
1158
+ refs_subrepo_fetch="refs/subrepo/$subref/fetch"
1159
+ refs_subrepo_push="refs/subrepo/$subref/push"
1160
+
1161
+ # Read/parse the .gitrepo file (unless clone/init; doesn't exist yet)
1162
+ if [[ ! $command =~ ^(clone|init)$ ]]; then
1163
+ read-gitrepo-file
1164
+ fi
1165
+
1166
+ true
1167
+ }
1168
+
1169
+ # Parse command line args according to a simple dsl spec:
1170
+ get-params() {
1171
+ local i=0
1172
+ local num=${#command_arguments[@]}
1173
+ for arg in $@; do
1174
+ local value="${command_arguments[i]}"
1175
+ value="${value//%/%%}"
1176
+ value="${value//\\/\\\\}"
1177
+ # If arg starts with '+' then it is required
1178
+ if [[ $arg == +* ]]; then
1179
+ if [[ $i -ge $num ]]; then
1180
+ usage-error "Command '$command' requires arg '${arg#+}'."
1181
+ fi
1182
+ printf -v ${arg#+} -- "$value"
1183
+ # Look for function name after ':' to provide a default value
1184
+ else
1185
+ if [[ $i -lt $num ]]; then
1186
+ printf -v ${arg%:*} -- "$value"
1187
+ elif [[ $arg =~ : ]]; then
1188
+ "${arg#*:}"
1189
+ fi
1190
+ fi
1191
+ let i=$((i+1))
1192
+ done
1193
+
1194
+ # Check for extra arguments:
1195
+ if [[ $num -gt $i ]]; then
1196
+ set -- ${command_arguments[@]}
1197
+ for ((j = 1; j <= i; j++)); do shift; done
1198
+ error "Unknown argument(s) '$*' for '$command' command."
1199
+ fi
1200
+ }
1201
+
1202
+ check-and-normalize-subdir() {
1203
+ # Sanity check subdir:
1204
+ [[ -n $subdir ]] ||
1205
+ die "subdir not set"
1206
+ [[ $subdir =~ ^/ || $subdir =~ ^[A-Z]: ]] &&
1207
+ usage-error "The subdir '$subdir' should not be absolute path."
1208
+ subdir="${subdir#./}"
1209
+ subdir="${subdir%/}"
1210
+ [[ $subdir != *//* ]] || subdir=$(tr -s / <<< "$subdir")
1211
+ }
1212
+
1213
+ # Determine the correct subdir path to use:
1214
+ guess-subdir() {
1215
+ local dir="$subrepo_remote"
1216
+ dir="${dir%.git}"
1217
+ dir="${dir%/}"
1218
+ dir="${dir##*/}"
1219
+ [[ $dir =~ ^[-_a-zA-Z0-9]+$ ]] ||
1220
+ error "Can't determine subdir from '$subrepo_remote'."
1221
+ subdir="$dir"
1222
+ check-and-normalize-subdir
1223
+ encode-subdir
1224
+ }
1225
+
1226
+ # Encode the subdir as a valid git ref format
1227
+ #
1228
+ # Input: env $subdir
1229
+ # Output: env $subref
1230
+ #
1231
+ # For detail rules about valid git refs, see the manual of git-check-ref-format:
1232
+ # URL: https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html
1233
+ # Shell: git check-ref-format --help
1234
+ #
1235
+ encode-subdir() {
1236
+ subref=$subdir
1237
+ if [[ ! $subref ]] || git check-ref-format "subrepo/$subref"; then
1238
+ return
1239
+ fi
1240
+
1241
+ ## 0. escape %, ensure the subref can be (almost) decoded back to subdir
1242
+ subref=${subref//%/%25}
1243
+
1244
+ ## 1. They can include slash / for hierarchical (directory) grouping,
1245
+ ## but no slash-separated component can begin with a dot . or
1246
+ ## end with the sequence .lock.
1247
+ subref=/$subref/
1248
+ subref=${subref//\/.//%2e}
1249
+ subref=${subref//.lock\//%2elock/}
1250
+ subref=${subref#/}
1251
+ subref=${subref%/}
1252
+
1253
+ ## 2. They must contain at least one /.
1254
+ ## Note: 'subrepo/' be will prefixed, so this is always true.
1255
+ ## 3. They cannot have two consecutive dots .. anywhere.
1256
+ subref=${subref//../%2e%2e}
1257
+ subref=${subref//%2e./%2e%2e}
1258
+ subref=${subref//.%2e/%2e%2e}
1259
+
1260
+ ## 4. They cannot have ASCII control characters
1261
+ ## (i.e. bytes whose values are lower than \040, or \177 DEL), space,
1262
+ ## tilde ~, caret ^, or colon : anywhere.
1263
+ ## 5. They cannot have question-mark ?, asterisk *,
1264
+ ## or open bracket [ anywhere.
1265
+ local i
1266
+ for (( i = 1; i < 32; ++i )); do
1267
+ # skip substitute NUL char (i=0), as bash will skip NUL in env
1268
+ local x=$(printf "%02x" $i)
1269
+ subref=${subref//$(printf "%b" "\x$x")/%$x}
1270
+ done
1271
+ subref=${subref//$'\177'/%7f}
1272
+ subref=${subref// /%20}
1273
+ subref=${subref//\~/%7e}
1274
+ subref=${subref//^/%5e}
1275
+ subref=${subref//:/%3a}
1276
+ subref=${subref//\?/%3f}
1277
+ subref=${subref//\*/%2a}
1278
+ subref=${subref//\[/%5b}
1279
+ subref=${subref//$'\n'/%0a}
1280
+
1281
+ ## 6. They cannot begin or end with a slash / or contain multiple
1282
+ ## consecutive slashes.
1283
+ ## Note: This rule is not revertable.
1284
+ [[ $subref != *//* ]] || subref=$(tr -s / <<< "$subref")
1285
+
1286
+ ## 7. They cannot end with a dot ..
1287
+ case "$subref" in
1288
+ *.) subref=${subref%.}
1289
+ subref+=%2e
1290
+ ;;
1291
+ esac
1292
+
1293
+ ## 8. They cannot contain a sequence @\{.
1294
+ subref=${subref//@\{/%40\{}
1295
+
1296
+ ## 9. They cannot be the single character @.
1297
+ ## Note: 'subrepo/' be will prefixed, so this is always true.
1298
+
1299
+ ## 10. They cannot contain a \.
1300
+ subref=${subref//\\/%5c}
1301
+
1302
+ subref=$(git check-ref-format --normalize --allow-onelevel "$subref") ||
1303
+ error "Can't determine valid subref from '$subdir'."
1304
+ }
1305
+
1306
+ #------------------------------------------------------------------------------
1307
+ # State file (`.gitrepo`) functions:
1308
+ #------------------------------------------------------------------------------
1309
+
1310
+ # Set subdir and gitrepo vars:
1311
+ read-gitrepo-file() {
1312
+ gitrepo="$subdir/.gitrepo"
1313
+
1314
+ if [[ ! -f $gitrepo ]]; then
1315
+ error "No '$gitrepo' file."
1316
+ fi
1317
+
1318
+ # Read .gitrepo values:
1319
+ if [[ -z $subrepo_remote ]]; then
1320
+ SAY=false OUT=true RUN git config --file="$gitrepo" subrepo.remote
1321
+ subrepo_remote="$output"
1322
+ fi
1323
+
1324
+ if [[ -z $subrepo_branch ]]; then
1325
+ SAY=false OUT=true RUN git config --file="$gitrepo" subrepo.branch
1326
+ subrepo_branch="$output"
1327
+ fi
1328
+
1329
+ SAY=false OUT=true RUN git config --file="$gitrepo" subrepo.commit
1330
+ subrepo_commit="$output"
1331
+
1332
+ FAIL=false \
1333
+ SAY=false OUT=true RUN git config --file="$gitrepo" subrepo.parent
1334
+ subrepo_parent="$output"
1335
+
1336
+ FAIL=false \
1337
+ SAY=false OUT=true RUN git config --file="$gitrepo" subrepo.method
1338
+ if [[ $output == "rebase" ]]; then
1339
+ join_method="rebase"
1340
+ else
1341
+ # This is the default method
1342
+ join_method="merge"
1343
+ fi
1344
+
1345
+ if [[ -z $subrepo_parent ]]; then
1346
+ FAIL=false \
1347
+ SAY=false OUT=true RUN git config --file="$gitrepo" subrepo.former
1348
+ subrepo_former="$output"
1349
+ fi
1350
+ }
1351
+
1352
+
1353
+ # Update the subdir/.gitrepo state file:
1354
+ update-gitrepo-file() {
1355
+ local short_commit=
1356
+
1357
+ local newfile=false
1358
+ if [[ ! -e $gitrepo ]]; then
1359
+
1360
+ FAIL=false RUN git cat-file -e "$original_head_commit":"$gitrepo"
1361
+
1362
+ if OK; then
1363
+ o "Try to recreate gitrepo file from $original_head_commit"
1364
+ git cat-file -p "$original_head_commit":"$gitrepo" > "$gitrepo"
1365
+ else
1366
+ newfile=true
1367
+ cat <<... > "$gitrepo"
1368
+ ; DO NOT EDIT (unless you know what you are doing)
1369
+ ;
1370
+ ; This subdirectory is a git "subrepo", and this file is maintained by the
1371
+ ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
1372
+ ;
1373
+ ...
1374
+ fi
1375
+ fi
1376
+
1377
+
1378
+ # TODO: only update remote and branch if supplied and $update_wanted
1379
+ if $newfile || [[ $update_wanted && -n $override_remote ]]; then
1380
+ RUN git config --file="$gitrepo" subrepo.remote "$subrepo_remote"
1381
+ fi
1382
+
1383
+ if $newfile || [[ $update_wanted && -n $override_branch ]]; then
1384
+ RUN git config --file="$gitrepo" subrepo.branch "$subrepo_branch"
1385
+ fi
1386
+
1387
+ RUN git config --file="$gitrepo" subrepo.commit "$upstream_head_commit"
1388
+ # Only write new parent when we are at the head of upstream
1389
+ if [[ -n $upstream_head_commit && -n $subrepo_commit_ref ]]; then
1390
+ OUT=true RUN git rev-parse "$subrepo_commit_ref"
1391
+ o "$upstream_head_commit == $output"
1392
+ if [[ $upstream_head_commit == $output ]]; then
1393
+ RUN git config --file="$gitrepo" subrepo.parent "$original_head_commit"
1394
+ fi
1395
+ fi
1396
+
1397
+ [[ -z $join_method ]] && join_method="merge"
1398
+ RUN git config --file="$gitrepo" subrepo.method "$join_method"
1399
+
1400
+ RUN git config --file="$gitrepo" subrepo.cmdver "$VERSION"
1401
+
1402
+ RUN git add -f -- "$gitrepo"
1403
+ }
1404
+
1405
+ #------------------------------------------------------------------------------
1406
+ # Enviroment checks:
1407
+ #------------------------------------------------------------------------------
1408
+
1409
+ # Check that system is ok for this command:
1410
+ assert-environment-ok() {
1411
+ type git &> /dev/null ||
1412
+ error "Can't find your 'git' command in '$PATH'."
1413
+
1414
+ git_version=$(git --version | cut -d ' ' -f3)
1415
+
1416
+ if [[ $(
1417
+ printf "$REQUIRED_GIT_VERSION\n$git_version" |
1418
+ sort -t. -k 1,1n -k 2,2n -k 3,3n |
1419
+ head -n1
1420
+ ) == "$git_version" &&
1421
+ $git_version != "$REQUIRED_GIT_VERSION"
1422
+ ]]; then
1423
+ error "Requires git version $REQUIRED_GIT_VERSION or higher; "`
1424
+ `"you have '$git_version'."
1425
+ fi
1426
+
1427
+ if [[ ${BASH_VERSINFO[0]} -lt 4 ]] ; then
1428
+ echo "The git-subrepo command requires that 'Bash 4+' is installed."
1429
+ echo "It doesn't need to be your shell, but it must be in your PATH."
1430
+ if [[ $OSTYPE == darwin* ]]; then
1431
+ echo "You appear to be on macOS."
1432
+ echo "Try: 'brew install bash'."
1433
+ echo "This will not change your user shell, it just installs 'Bash 5.x'."
1434
+ fi
1435
+ exit 1
1436
+ fi
1437
+ }
1438
+
1439
+ # Make sure git repo is ready:
1440
+ assert-repo-is-ready() {
1441
+ # Skip this for trivial info commands:
1442
+ [[ $command =~ ^(help|version|upgrade)$ ]] && return
1443
+
1444
+ # We must be inside a git repo:
1445
+ git rev-parse --git-dir &> /dev/null ||
1446
+ error "Not inside a git repository."
1447
+
1448
+ # Get the original branch and commit:
1449
+ git:get-head-branch-name
1450
+ original_head_branch="$output"
1451
+
1452
+ # If a subrepo branch is currently checked out, then note it:
1453
+ if [[ $original_head_branch =~ ^subrepo/(.*) ]]; then
1454
+ error "Can't '$command' while subrepo branch is checked out."
1455
+ fi
1456
+
1457
+ # Make sure we are on a branch:
1458
+ [[ $original_head_branch == HEAD || -z $original_head_branch ]] &&
1459
+ error "Must be on a branch to run this command."
1460
+
1461
+ # In a work-tree:
1462
+ SAY=false OUT=true RUN git rev-parse --is-inside-work-tree
1463
+ [[ $output == true ]] ||
1464
+ error "Can't 'subrepo $command' outside a working tree."
1465
+
1466
+ # HEAD exists:
1467
+ [[ $command == clone ]] ||
1468
+ RUN git rev-parse --verify HEAD
1469
+
1470
+ assert-working-copy-is-clean
1471
+
1472
+ # For now, only support actions from top of repo:
1473
+ if [[ -n "$(git rev-parse --show-prefix)" ]]; then
1474
+ error "Need to run subrepo command from top level directory of the repo."
1475
+ fi
1476
+ }
1477
+
1478
+ assert-working-copy-is-clean() {
1479
+ # Repo is in a clean state:
1480
+ if [[ $command =~ ^(clone|init|pull|push|branch|commit)$ ]]; then
1481
+ # TODO: Should we check for untracked files?
1482
+ local pwd=$(pwd)
1483
+ o "Assert that working copy is clean: $pwd"
1484
+ git update-index -q --ignore-submodules --refresh
1485
+ git diff-files --quiet --ignore-submodules ||
1486
+ error "Can't $command subrepo. Unstaged changes. ($pwd)"
1487
+ if [[ $command != clone ]] || git:rev-exists HEAD; then
1488
+ git diff-index --quiet --ignore-submodules HEAD ||
1489
+ error "Can't $command subrepo. Working tree has changes. ($pwd)"
1490
+ git diff-index --quiet --cached --ignore-submodules HEAD ||
1491
+ error "Can't $command subrepo. Index has changes. ($pwd)"
1492
+ else
1493
+ # Repo has no commits and we're cloning a subrepo. Working tree won't
1494
+ # possibly have changes as there was nothing initial to change.
1495
+ [[ -z $(git ls-files) ]] ||
1496
+ error "Can't $command subrepo. Index has changes. ($pwd)"
1497
+ fi
1498
+ fi
1499
+ }
1500
+
1501
+ # If subdir exists, make sure it is empty:
1502
+ assert-subdir-ready-for-init() {
1503
+ if [[ ! -e $subdir ]]; then
1504
+ error "The subdir '$subdir' does not exist."
1505
+ fi
1506
+ if [[ -e $subdir/.gitrepo ]]; then
1507
+ error "The subdir '$subdir' is already a subrepo."
1508
+ fi
1509
+ # Check that subdir is part of the repo
1510
+ if [[ -z $(git log -1 --date=default -- $subdir) ]]; then
1511
+ error "The subdir '$subdir' is not part of this repo."
1512
+ fi
1513
+ }
1514
+
1515
+ # If subdir exists, make sure it is empty:
1516
+ assert-subdir-empty() {
1517
+ if [[ -e $subdir ]] && [[ -n $(ls -A $subdir) ]]; then
1518
+ error "The subdir '$subdir' exists and is not empty."
1519
+ fi
1520
+ }
1521
+
1522
+ #------------------------------------------------------------------------------
1523
+ # Getters of various information:
1524
+ #------------------------------------------------------------------------------
1525
+
1526
+ # Find all the current subrepos by looking for all the subdirectories that
1527
+ # contain a `.gitrepo` file.
1528
+ get-all-subrepos() {
1529
+ local paths=($(git ls-files | sed -n 's!/\.gitrepo$!!p' | sort))
1530
+ subrepos=()
1531
+ local path
1532
+ for path in "${paths[@]}"; do
1533
+ add-subrepo "$path"
1534
+ done
1535
+ }
1536
+
1537
+ add-subrepo() {
1538
+ if ! $ALL_wanted; then
1539
+ for path in "${subrepos[@]}"; do
1540
+ [[ $1/ =~ ^$path/ ]] && return
1541
+ done
1542
+ fi
1543
+ subrepos+=("$1")
1544
+ }
1545
+
1546
+ # Determine the upstream's default head branch:
1547
+ get-upstream-head-branch() {
1548
+ OUT=true RUN git ls-remote $subrepo_remote
1549
+ local remotes="$output"
1550
+ [[ -n $remotes ]] ||
1551
+ error "Failed to 'git ls-remote $subrepo_remote'."
1552
+ local commit="$(
1553
+ echo "$remotes" |
1554
+ grep HEAD |
1555
+ cut -f1
1556
+ )"
1557
+ local branch="$(
1558
+ echo "$remotes" |
1559
+ grep -E "$commit[[:space:]]+refs/heads/" |
1560
+ grep -v HEAD |
1561
+ head -n1 |
1562
+ cut -f2
1563
+ )"
1564
+ [[ $branch =~ refs/heads/ ]] ||
1565
+ error "Problem finding remote default head branch."
1566
+ output="${branch#refs/heads/}"
1567
+ }
1568
+
1569
+ # Commit msg for an action commit:
1570
+ # Don't use RUN here as it will pollute commit message
1571
+ get-commit-message() {
1572
+ local commit="none"
1573
+ if git:rev-exists "$upstream_head_commit"; then
1574
+ commit=$(git rev-parse --short "$upstream_head_commit")
1575
+ fi
1576
+
1577
+ local args=() debug_wanted=false
1578
+ if $all_wanted; then
1579
+ args+=("$subdir")
1580
+ fi
1581
+ args+=(${commit_msg_args[@]})
1582
+
1583
+ # Find the specific git-subrepo code used:
1584
+ local command_remote='???'
1585
+ local command_commit='???'
1586
+ get-command-info
1587
+
1588
+ local merged="none"
1589
+ if git:rev-exists "$subrepo_commit_ref"; then
1590
+ merged=$(git rev-parse --short "$subrepo_commit_ref")
1591
+ fi
1592
+
1593
+ local is_merge=""
1594
+ if [[ $command != push ]]; then
1595
+ if git:is_merge_commit "$subrepo_commit_ref"; then
1596
+ is_merge=" (merge)"
1597
+ fi
1598
+ fi
1599
+
1600
+ # TODO: Consider output for push!
1601
+
1602
+ # Format subrepo commit message:
1603
+ cat <<...
1604
+ git subrepo $command$is_merge ${args[@]}
1605
+
1606
+ subrepo:
1607
+ subdir: "$subdir"
1608
+ merged: "$merged"
1609
+ upstream:
1610
+ origin: "$subrepo_remote"
1611
+ branch: "$subrepo_branch"
1612
+ commit: "$commit"
1613
+ git-subrepo:
1614
+ version: "$VERSION"
1615
+ origin: "$command_remote"
1616
+ commit: "$command_commit"
1617
+ ...
1618
+ }
1619
+
1620
+ # Get location and version info about the git-subrepo command itself. This
1621
+ # info goes into commit messages, so we can find out exactly how the commits
1622
+ # were done.
1623
+ get-command-info() {
1624
+ local bin="$0"
1625
+ if [[ $bin =~ / ]]; then
1626
+ local lib="$(dirname "$bin")"
1627
+ # XXX Makefile needs to install these symlinks:
1628
+ # If `git-subrepo` was system-installed (`make install`):
1629
+ if [[ -e $lib/git-subrepo.d/upstream ]] &&
1630
+ [[ -e $lib/git-subrepo.d/commit ]]; then
1631
+ command_remote=$(readlink "$lib/git-subrepo.d/upstream")
1632
+ command_commit=$(readlink "$lib/git-subrepo.d/commit")
1633
+ elif [[ $lib =~ / ]]; then
1634
+ lib="$(dirname "$lib")"
1635
+ if [[ -d $lib/.git ]]; then
1636
+ local remote="$(
1637
+ GIT_DIR=$lib/.git git remote -v |
1638
+ grep '^origin' |
1639
+ head -n1 |
1640
+ cut -f2 |
1641
+ cut -d ' ' -f1
1642
+ )"
1643
+ if [[ -n $remote ]]; then
1644
+ command_remote="$remote"
1645
+ else
1646
+ local remote="$(
1647
+ GIT_DIR=$lib/.git git remote -v |
1648
+ head -n1 |
1649
+ cut -f2 |
1650
+ cut -d ' ' -f1
1651
+ )"
1652
+ if [[ -n $remote ]]; then
1653
+ command_remote="$remote"
1654
+ fi
1655
+ fi
1656
+ local commit="$(GIT_DIR="$lib/.git" git rev-parse --short HEAD)"
1657
+ if [[ -n $commit ]]; then
1658
+ command_commit="$commit"
1659
+ fi
1660
+ fi
1661
+ fi
1662
+ fi
1663
+ }
1664
+
1665
+ #------------------------------------------------------------------------------
1666
+ # Instructional errors:
1667
+ #------------------------------------------------------------------------------
1668
+
1669
+ error-join() {
1670
+ cat <<...
1671
+
1672
+ You will need to finish the $command by hand. A new working tree has been
1673
+ created at $worktree so that you can resolve the conflicts
1674
+ shown in the output above.
1675
+
1676
+ This is the common conflict resolution workflow:
1677
+
1678
+ 1. cd $worktree
1679
+ 2. Resolve the conflicts (see "git status").
1680
+ 3. "git add" the resolved files.
1681
+ ...
1682
+
1683
+ if [[ "$join_method" == "rebase" ]]; then
1684
+ cat <<...
1685
+ 4. git rebase --continue
1686
+ ...
1687
+ else
1688
+ cat <<...
1689
+ 4. git commit
1690
+ ...
1691
+ fi
1692
+
1693
+ cat <<...
1694
+ 5. If there are more conflicts, restart at step 2.
1695
+ 6. cd $start_pwd
1696
+ ...
1697
+ local branch_name="${branch:=subrepo/$subdir}"
1698
+ if [[ "$command" == "push" ]]; then
1699
+ cat <<...
1700
+ 7. git subrepo push $subdir $branch_name
1701
+ ...
1702
+ else
1703
+ cat <<...
1704
+ 7. git subrepo commit $subdir
1705
+ ...
1706
+ fi
1707
+
1708
+ if [[ "$command" == "pull" && "$join_method" == "rebase" ]]; then
1709
+ cat <<...
1710
+
1711
+ After you have performed the steps above you can push your local changes
1712
+ without repeating the rebase by:
1713
+ 1. git subrepo push $subdir $branch_name
1714
+
1715
+ ...
1716
+ fi
1717
+
1718
+ cat <<...
1719
+ See "git help $join_method" for details.
1720
+
1721
+ Alternatively, you can abort the $command and reset back to where you started:
1722
+
1723
+ 1. git subrepo clean $subdir
1724
+
1725
+ See "git help subrepo" for more help.
1726
+
1727
+ ...
1728
+ }
1729
+
1730
+ #------------------------------------------------------------------------------
1731
+ # Git command wrappers:
1732
+ #------------------------------------------------------------------------------
1733
+
1734
+ git:branch-exists() {
1735
+ git:rev-exists "refs/heads/$1"
1736
+ }
1737
+
1738
+ git:rev-exists() {
1739
+ git rev-list "$1" -1 &> /dev/null
1740
+ }
1741
+
1742
+ git:ref-exists() {
1743
+ test -n "$(git for-each-ref "$1")"
1744
+ }
1745
+
1746
+ git:get-head-branch-name() {
1747
+ output=
1748
+ local name="$(git symbolic-ref --short --quiet HEAD)"
1749
+ [[ $name == HEAD ]] && return
1750
+ output="$name"
1751
+ }
1752
+
1753
+ git:get-head-branch-commit() {
1754
+ output="$(git rev-parse HEAD)"
1755
+ }
1756
+
1757
+ git:commit-in-rev-list() {
1758
+ local commit="$1"
1759
+ local list_head="$2"
1760
+ git rev-list "$list_head" | grep -q "^$commit"
1761
+ }
1762
+
1763
+ git:make-ref() {
1764
+ local ref_name="$1"
1765
+ local commit="$(git rev-parse "$2")"
1766
+ RUN git update-ref "$ref_name" "$commit"
1767
+ }
1768
+
1769
+ git:is_merge_commit() {
1770
+ local commit="$1"
1771
+ git show --summary "$commit" | grep -q ^Merge:
1772
+ }
1773
+
1774
+ git:create-worktree() {
1775
+ local branch="$1"
1776
+ worktree="$GIT_TMP/$branch"
1777
+ RUN git worktree add "$worktree" "$branch"
1778
+ }
1779
+
1780
+ git:remove-worktree() {
1781
+ o "Remove worktree: $worktree"
1782
+ if [[ -d "$worktree" ]]; then
1783
+ o "Check worktree for unsaved changes"
1784
+ cd "$worktree"
1785
+ assert-working-copy-is-clean
1786
+ cd "$start_pwd"
1787
+
1788
+ o "Clean up worktree $worktree"
1789
+ rm -rf "$worktree"
1790
+ RUN git worktree prune
1791
+ fi
1792
+ }
1793
+
1794
+ git:delete-branch() {
1795
+ local branch="$1"
1796
+ o "Deleting old '$branch' branch."
1797
+ # Remove worktree first, otherwise you can't delete the branch
1798
+ git:remove-worktree
1799
+ FAIL=false RUN git branch -D "$branch"
1800
+ }
1801
+
1802
+
1803
+ #------------------------------------------------------------------------------
1804
+ # Low level sugar commands:
1805
+ #------------------------------------------------------------------------------
1806
+
1807
+ # Smart command runner:
1808
+ RUN() {
1809
+ $debug_wanted && $SAY && say '>>>' $*
1810
+ if $EXEC; then
1811
+ "$@"
1812
+ return $?
1813
+ fi
1814
+
1815
+ OK=true
1816
+ set +e
1817
+ local rc=
1818
+ local out=
1819
+ if $debug_wanted && $TTY && interactive; then
1820
+ "$@"
1821
+ else
1822
+ if $OUT; then
1823
+ out="$("$@" 2>/dev/null)"
1824
+ else
1825
+ out="$("$@" 2>&1)"
1826
+ fi
1827
+ fi
1828
+ rc=$?
1829
+ set -e
1830
+
1831
+ if [[ $rc -ne 0 ]]; then
1832
+ OK=false
1833
+ $FAIL && error "Command failed: '$*'.\n$out"
1834
+ fi
1835
+ output="$out"
1836
+ }
1837
+
1838
+
1839
+ interactive() {
1840
+ if [[ -t 0 && -t 1 ]]; then
1841
+ return 0
1842
+ else
1843
+ return 1
1844
+ fi
1845
+ }
1846
+
1847
+ # Call a function with indent increased:
1848
+ CALL() {
1849
+ local INDENT=" $INDENT"
1850
+ "$@" || true
1851
+ }
1852
+
1853
+ # Print verbose steps for commands with steps:
1854
+ o() {
1855
+ if $verbose_wanted; then
1856
+ echo "$INDENT* $@"
1857
+ fi
1858
+ }
1859
+
1860
+ # Print unless quiet mode:
1861
+ say() {
1862
+ $quiet_wanted || echo "$@"
1863
+ }
1864
+
1865
+ # Print to stderr:
1866
+ err() {
1867
+ echo "$@" >&2
1868
+ }
1869
+
1870
+ # Check if OK:
1871
+ OK() {
1872
+ $OK
1873
+ }
1874
+
1875
+ # Nicely report common error messages:
1876
+ usage-error() {
1877
+ local msg="git-subrepo: $1" usage=
1878
+ if [[ $GIT_SUBREPO_TEST_ERRORS != true ]]; then
1879
+ source "${SOURCE_DIR}/git-subrepo.d/help-functions.bash"
1880
+ if can "help:$command"; then
1881
+ msg=$'\n'"$msg"$'\n'"$("help:$command")"$'\n'
1882
+ fi
1883
+ fi
1884
+ echo "$msg" >&2
1885
+ exit 1
1886
+ }
1887
+
1888
+ # Nicely report common error messages:
1889
+ error() {
1890
+ local msg="git-subrepo: $1" usage=
1891
+ echo -e "$msg" >&2
1892
+ exit 1
1893
+ }
1894
+
1895
+ # Start at the end:
1896
+ [[ $BASH_SOURCE != "$0" ]] || main "$@"
1897
+
1898
+ # Local Variables:
1899
+ # tab-width: 2
1900
+ # sh-indentation: 2
1901
+ # sh-basic-offset: 2
1902
+ # End:
1903
+ # vim: set ft=sh sw=2 lisp: