carvel-dev / carvel-dev/vendir

A 'dev' mode to preserve local changes in git/hg repositories

Open
#388 8 comments 2 reactions 1 assignee Claimed by @rohitagg2020 View on GitHub
discussion enhancement
Dominant language
Go
Stars
399
Forks
73
Avg merge
2h 53m
Merged PRs (30d)
2

Description

**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:
- if the target directory already exists, keep it
- when using already existing target :
* check if non-committed changes exists, in which case the sync is aborted
* fetch & checkout directly in the target directory

A new command "dev-baseline" (for example) would, for each vcs directory, determine what the current ref is:
- if current revision has a tag, the tag
- otherwise, the sha of the current revision
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.