Skip to content

clever-systems/subtree-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

subtree-patterns

My notepad for [git-subtree] patterns for drupal sysop. [git-subtree]: https://github.com/apenwarr/git-subtree

Links:

General objectives

  • Patches to all components are tracked in the repository
  • Patches can be re-applied after updates
  • On updates patches should be rebased to easily re-upstream them

Research topics

  • Rebasing subtrees?
  • Checkout a tag and have detached head?
  • Slim subtree with only relevant commits to reduce repo weight? This will give for every use case a different solution.
  • Can we drush-download from git directly into a subtree? Maybe with a suitable git pull versiontag:foo-upstream?
  • Can we drush-download from git a single commit?
  • See git fetch --depth 1, git checkout --orphan new-branch, git checkout tree-ish -- .
  • See git - Why can't I push from a shallow clone? - Stack Overflow

Comparison to submodules

  • (+) Has more drive, better toolbase and less clutter
  • (+) Everything in repo, so does not rely on network connection
  • (-) Not supported yet by drush and git_deploy.module
  • (-) Large repository weight

Slim subtree use cases

Make component a subtree

  • Subtree add foo-patched (checked out)
  • Add branch foo-upstream = foo-patched
  • (none of tha foo patches has a origin yet)

Update component

  • In workspace fork
  • checkout foo-upstream
  • dl foo & commit
  • checkout foo-patched
  • rebase

Push patches

  • Add foo fork repo branch mysite-patches as remote of foo-patched
  • push
  • cherry-pick them

Complete subtree use cases - TODO

Get new component as subtree

Make existing unpatched component a subtree

Make existing patched component a subtree

Add or swap remote repository

Appendix: Rebasing merge commits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •