-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git integration for themes #416
Conversation
This is great! |
It's an interesting idea, keeping the location of the git repository in the CBT plugin folder rather than directly in /themes. I'm keen to know your thoughts of why that is better than managing the resources directly in the /themes folder. One potential downside is that I'm not able to connect my repository and then immediately have access to any theme that I might have just connected. That's also a positive too though; connecting the Automattic/themes repo doesn't immediately fill my theme selection with ALL of the themes. Because of the folder structuring this seems best suited for a repository (like Automattic/themes) where the theme would be in a folder. Perhaps less well suited for a repository that has only one theme (like the many premium offerings, or most themes I see in the wild). How do you imagine changing which branch a user is on would work? Is this something better suited for integration in the editor rather than wp-admin? The biggest and most important question though is of course "Is CBT the right place for this work?" I've gone back and forth on that question a dozen times over the past few months. It would be relatively easy to combine this work and the work I've done on Rivisr to bring the functionality right into CBT. Does that seem like it would have value? |
Yes, Agree that it suites better within the editor. I did the first version in wp-admin because it is quick 😄
The main reasoning is that the theme cannot be committed directly to repository, because it requires transformations such as removal of
I thought through this scenario and considered having this variable target_path.
This would be some interesting scenario to solve. Plugin could fetch the list of open branches from the repository using the access token or have a user input for the first iteration. In this first iteration, I have always considered default branch |
bd5d59a
to
a579fa7
Compare
a579fa7
to
bd47175
Compare
So far this is the biggest hurdle for me to get over. This made sense at first glance, however I don't believe I agree. These transformations are necessary, but if they are necessary in the exported theme then are they not also necessary (or at least reasonable) in the installed theme? Themes 'saved' via CBT should be in a clean state. Theme attributes, ref attributes, etc shouldn't be in the templates; those should remain in the user space. If CBT isn't handling all of those scenarios well then that's a failing of CBT and not something I think we should try to work around.
This also doesn't seem like a good reason to have the repository stored elsewhere. In the case of the Automattic public themes repository those themes would be in |
I tried to tinker in here yesterday and today and I really just haven't been able to get past the theme repository being outside of the /themes folder. I'm pretty convinced that this should be refactored to leverage the repository there instead of keeping it "somewhere else" and trying to work on it from there. I started to do that today but I got very confused and wasn't able to make much progress. I'm going to put that down for now until we have an opportunity to discuss further. |
Thank you for chatting with me about this. I do see the advantage of keeping the "working copy repo" outside of the /themes folder now. I'm still not convinced that the resources saved in the /themes folder shouldn't be "fully ready to go" and need further exporting. Regardless, managing the repos in this way makes for convenient possibilities. |
git integration looks like it's not going to be a part of CBT (the closest being the playground integration). Closing as "an interesting experiment". |
🚧 WORK in PROGRESS 🚧
Related issues:
#435