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

Ignore the only root .git directory #496

Merged
merged 1 commit into from
Dec 22, 2022
Merged

Conversation

ihor-sviziev
Copy link
Contributor

While working with m2 projects, it's quite a frequent case when you have a separate git repository per extension, so while developing something you're installing a module from a branch, do your changes directly in vendor/<vendor_name>/<module_name> and then do commits directly from this. Such flow helps significantly reduce time on installing each new version via composer.

The issue with Warden in such configuration is that ALL .git folders are ignored in the mutagen config. As a result - on Mac OS, you can't see the diff, commit changes, etc. (the .git directory is entirely missing in the module folder)

My PR changes this behavior by ignoring the only root directory git repo.

@dudzio12
Copy link

I temporary use:

WARDEN_SYNC_IGNORE=!vendor/vendor-name/*/.git

inside .env config file.

@Den4ik
Copy link

Den4ik commented Apr 20, 2022

I faced with pure performance on one of my projects when ignored vsc.
So currently I use version control only from MacOS and don't use it inside containers

@stale
Copy link

stale bot commented Jul 21, 2022

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jul 21, 2022
@ihor-sviziev
Copy link
Contributor Author

@navarr, what do you think about porting this change to https://github.com/swiftotter/den?

@navarr
Copy link
Member

navarr commented Jul 27, 2022

@ihor-sviziev Why have the git repositories in the container instead of on the host machine?

@stale stale bot removed the stale label Jul 27, 2022
@ihor-sviziev
Copy link
Contributor Author

ihor-sviziev commented Jul 27, 2022

@navarr, as I described in the original message, is the use case when you're having a single module in a few Magento 2 projects. Usually, to simplify development, we install the module via composer update <vendor_name>/<module_name> --prefer-source, which installs the module as a git repository. Then we just add needed changes in that module's directory (/vendor/<vendor_name>/<module_name>/) and run git add, git commit, and git push from the module's directory.

Right now, mutagen sync excludes all the git repositories from the sync, so it means inside the container, we do have a .git directory, but on the host machine, we don't, so we can't commit and push from the host machine.

I think the people who upvoted my change do the same flow as I am.

PS: I have a workaround for my case - #496 (comment), but would like to make it available for everyone. If it causes any issues - I'm ok to have a fix just for me.

@ihor-sviziev
Copy link
Contributor Author

@navarr what do you think about porting this change to den?

@navarr
Copy link
Member

navarr commented Sep 1, 2022

@ihor-sviziev I think this is likely a good and useful change. Can you open a PR against Den?

@navarr navarr merged commit 229f9c9 into wardenenv:develop Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants