Skip to content
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

Multiple branches while syncing plugin's config #197

Closed
ghost opened this issue Apr 24, 2021 · 5 comments
Closed

Multiple branches while syncing plugin's config #197

ghost opened this issue Apr 24, 2021 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 24, 2021

Hi all,

I have a git repository using multiple branches and each of them is served by a dedicated grav application.

Everything goes very well if I sync the pages and template directories. As I don't always remember all the setup done in one branch (and since it's not very clean to manuall copy the config directory between instances), I synced the plugin's directory (which work pretty well for all plugins except the git-sync one).

As the plugin config contains the local and remote branch name, every time I merge branch, this setting is overwritten and I must manually fix it in the grav's admin panel.

I thought I could use some .gitignore trick to ignore this specific plugin directory but saw #117.

Do you have some advices or best practices for such cases (having two grav, following different branches) ?

@w00fz
Copy link
Member

w00fz commented Apr 24, 2021

I think what I need to do is to add an advanced textarea field where you can specify your gitignore, so that when GitSync does its thing, it will also include the custom entries.

Do you think that would help with the issue?

@ghost
Copy link
Author

ghost commented Apr 26, 2021

Any way to tell the plugin to ignore its own config file will help me. A "true/false" to tell grav to read the official gitignore file, a "filename" field to tell grav where it will find a gitignore file or a textarea with a content formatted like a gitignore file (your proposal) wille help me.

The textarea has a good side effect because, I can still version a git-sync configuration in my repo :

  • If it tells the plugin to ignore its configuration, the grav instance will stick on this specific branch (and configuration) after the first synchronization,
  • Else, I can manually setup multiple instances, some of them with the ignore so that they follows their branches, some others without the ignore to follow the branch written in the config file in the repo.

Note that I don't need the second case (because merging setup files that contains branch names need to check the name after merge and re-commit to correct if it is the wrong one).

@w00fz w00fz closed this as completed in ea50fec Apr 27, 2021
@w00fz
Copy link
Member

w00fz commented Apr 27, 2021

I've got this implemented, going to be releasing it soon as v2.3.0. Thanks for this suggestion, going to be very useful.


w00fz-2021-04-27_@_10 25 01@2x

@ghost
Copy link
Author

ghost commented Apr 28, 2021

I've just updated my plugin and put the git-sync config in the ignore list as follows :

image

After I saved the plugin state, It commited the setup modification in my repo :

image

Since then, whatever I change in the configuration file, it's not updated (as expected) :

  • Changes via the plugin are no more commited so the repo does not change,
  • Changes in the repo (and pushed to origin), after the webhook call to the plugin, are not taken by the plugin so it remain in the same state.

Thanks a lot :-)

@w00fz
Copy link
Member

w00fz commented Apr 28, 2021

Happy to hear this is working as you expected! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant