This patch allows one to specify a subtree from a git repository, in case a module/theme/profile is stored in a subdirectory.

With SVN this is always possible since a subdirectory can be specified inside the repository URL. This patch brings the same functionality to Git checkouts.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

arnebrasseur’s picture

Issue tags: +git
FileSize
1.17 KB
patcon’s picture

I would just like to point out a potential alternative use for this.

Lots of themes have starter subthemes. Right now, creating a theme from that involves copying the files out and losing commit history. It would be great if we could clone the theme repo, create a branch for a custom theme, and make the namespacing changes to the starter subtheme. That way, we can easily pull in updated from the master branch. If drushmake allowed for subtree git cloning, then we could work like this, and keep our development more cohesive.

Haven't actually tried this yet, but I think it should work. Correct me if I'm wrong. :)

patcon’s picture

patcon’s picture

Status: Active » Needs review

Just gave it a spin on v2.2 of drush_make, and it works A-OK for my use-case!
thanks arnebrasseur! In the future, setting the status to "Needs Review" once you submit a patch will help it get noticed by the folks with commit access :)

mrhanlon’s picture

Just what I needed. Worked perfectly, thanks.

+1

MichaelCole’s picture

MichaelCole’s picture

Status: Reviewed & tested by the community » Needs review

Patch works great!

MichaelCole’s picture

My bad. After more testing, original patch works great :-) Ignore this broken patch.

MichaelCole’s picture

Status: Needs review » Reviewed & tested by the community
MichaelCole’s picture

Version: 6.x-3.x-dev » 6.x-2.2
Status: Needs review » Reviewed & tested by the community

FWIW, this patch works on 2.2. Haven't tried it on 3.x.

patcon’s picture

To clarify, the approach above that I mentioned does work, and goes like this:

  1. Clone theme (or, fork on github: https://github.com/ThemeGeeks/Omega)
  2. git checkout -b mytheme
  3. git mv mynewtheme git mv starterkits/omega-html5 starterkits/mytheme
  4. rename filenames appropriatly using "git mv"
  5. use sed command to rename internal functions appropriately
  6. commit your changes and push ti github
  7. Use the subtree strategy with drush_make to pull just the starter theme dir into your themes dir (you'll need another drush_make entry to pull in the main theme separately)
  8. whenever the starter theme is updated, do a git rebase to pull in the changes with less hassle

Should make it simpler to keep custome starter themes updated :)

ao2’s picture

@arnebrasseur: I tried to change the style and naming to match the one used in #919224: Allow use of subtrees or individual file from archives instead of the whole archive; see the attached patch, is this OK to you?

I am taking this patch in the set for that issue, and I'll try to get it merged along with the others about $download['subtree'] (preserving your authorship of course).

Regards,
Antonio

anarcat’s picture

Status: Reviewed & tested by the community » Needs review

seems to me this is a new patch that needs testing! setting status accordingly.

helmo’s picture

Project: Drush Make » Drush
Version: 6.x-2.2 »
Component: Code » Make
Status: Needs review » Needs work

[ Powered by #1115636: Issue Macros and Templates - Drush Make]

Drush make is being merged into drush core (discussed in issue:#1310130: Put drush make in drush core)
This means that the issue queue is also moving. The drush queue has a component 'Make' especially for drush_make.

More information will be posted on the drush_make and drush project pages.

Cyclodex’s picture

Is this still not implemented in drush ? I am a bit confused about this topic over here, looks like this is separated drush for drupal.org ?

#1482888: Support 'subtree' download attribute for libraries

greg.1.anderson’s picture

Version: » 8.x-6.x-dev
Status: Needs work » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.

drzraf’s picture