bradp / vv

:globe_with_meridians: Variable VVV - a VVV Site Creation Wizard.‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ :x: This project is no longer maintained. Please update your copy of VVV , which has most of the vv features built in.
GNU General Public License v2.0
1k stars 89 forks source link

Git subtree repo can not be created #308

Open franz-josef-kaiser opened 8 years ago

franz-josef-kaiser commented 8 years ago

Expected functionality

Projects that come as "complete" project (WP core including all files), can be used as well as /wp-content-only repos. More often than one wants to admit, we are taking "all in" repos over. Those repos do not contain only single themes or plugins, but everything from WP core to mu-plugins and even an uploads folder. The easiest way to deal with such repos seems to be a Git Subtree split out:

$ git subtree split --prefix=wp-content -b my-wp-content-branch
$ git checkout my-wp-content-branch
$ git push -u origin my-wp-content-branch

Not working/ Missing functionality

As it currently stands – in code – it is not possible to use a Git subtree split out as project:

if [ ! -z "$git_repo" ]; then
    git clone --recursive "$git_repo" $web_root/wp-content
fi

Steps to reproduce

  1. Set up VVV
  2. Add VV
  3. Call vv create
  4. Add a Git Subtree split out as repo

    Git repo to clone as wp-content (leave blank to skip): -b my-wp-content-subtree-branch --single-branch git@github.com:username/reponame.git

    How to change

The easiest and most obvious step would be to split the command in multiple commands, so the $git_repo var is not equal to a branch, while the master could be the default branch. Bonus: This might also help to pull down development branches that are used for testing or staging environments where only squashed commits get merged to master to allow for a tagged release-history for production.