-
Notifications
You must be signed in to change notification settings - Fork 52
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
A 'dev' mode to preserve local changes in git/hg repositories #388
Comments
@cdevienne Could you through some more light on this use case. vendir is used to pull config from a source. It seems like you also want to make changes in the same config and then be able to pull more changes from the source, which would make vendir work on two different source of truths. |
One of our use cases is the following: we have repositories for odoo modules, that we sync in a top-level client project. When working on the client project, the developer updates some code in synced sub-repo(s), runs some tests locally and when satisfied commit changes in both the synced sub-repo(s) and the top-level repo. When working a sub-repo, there is a period of time where the synced directory is not in-sync. So not really 2 sources of truth, just a gray area, until one those 2 events happen:
We can already do this with vendir but it requires to be very careful if we don't want to lose any local change because 'sync' will drop everything and start over. The changes we suggest in "vendir sync" provide safety for the local changes, and would work a little like the "--lazy" option but safer. So no added need for merging configurations. And the "dev-baseline" command is to make the vendir configuration update easier. |
@cdevienne We had a discussion on this in the last community meeting. Some of the ideas shared were:
We can come up with proposal together on the same. |
I agree "dev" might not be the ideal name. But it is not a "skip" either because the key ideas are:
I guess it applies only to git & mercurial repositories. |
We are thinking more from the generic behavior on the vendir side. For the following scenario:
I believe you will do |
Our main goal is to secure local changes by default, so a "vendir sync" can never mean loosing some work. If we cannot do a fetch (which btw would be a lot faster) instead of cloning, then we need to make sure, before deleting any git/hg repo, that they have no local commits and no local change (including staged ones). If we favor this approach, then a "safe" mode could make sense. |
Are you thinking about |
Yes, a "--safe" flag is what I have in mind. It could be turned on with an environment variable too (also maybe in the vendir.yml configuration).
|
Describe the problem/challenge you have
We use vendir in meta-projects, and work directly in the git/hg synced sub-repositories.
After doing some changes in them, we cannot do a "vendir sync" without loosing local changes (and lazy doesn't work if we pull some ref changes).
Also, after commit & pushing changes in the sub-repositories, we would like to automatically update the vendir configuration file with the current commit id/tag of each repo.
Describe the solution you'd like
We think vendir could benefit from a "dev" mode, which would be enabled by using a "dev-sync" command or a "--dev" switch on the sync command.
When turned on, vendir would change its sync behavior for mercurial and git (at least) in the following way:
A new command "dev-baseline" (for example) would, for each vcs directory, determine what the current ref is:
If the ref in the vendir file is not a branch (or a topic the mercurial case), and does not match the current ref determined above, the configuration is updated with the new current ref.
Anything else you would like to add:
The overall experience is inspired by the "hg-confman" mercurial extension that we intend to replace with vendir.
We are willing to work on an implementation for these features, and would like your opinion before diving into coding.
The text was updated successfully, but these errors were encountered: