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

[feature] self checkout from a branch #252

Open
andry81 opened this issue Mar 7, 2023 · 0 comments
Open

[feature] self checkout from a branch #252

andry81 opened this issue Mar 7, 2023 · 0 comments

Comments

@andry81
Copy link

andry81 commented Mar 7, 2023

Sometimes need to checkout a branch that is already downloaded into the repository because that branch is a child directory to another repository branch:

repositories:

  _externals/3_14_x:
    type:         git
    url:          .
    version:      3_14_x

  _externals/3_15_x:
    type:         git
    url:          .
    version:      3_15_x

, where the 3_x is a parent (master) branch containing that .externals file.

Because 3_14_x and 3_15_x already downloaded, then I don't want to download them again and want to use current repository in the url: .

Or, for example, I could fetch only 3_14_x and don't want to fetch 3_15_x because each branch could weight hundreds of megabytes and I don't want to fetch them all in vcs import ....

Or may be more advanced syntax:

repositories:

  _externals/3_14_x:
    type:             git
    url:              <path-to-remote-repo-1>
    version:          3_14_x
    fetch-to-branch:  3_14_x

  _externals/3_15_x:
    type:             git
    url:              <path-to-remote-repo-1>
    version:          3_15_x
    fetch-to-branch:  3_15_x

, where fetch-to-branch will override default fetch and will checkout from the local branch.

Additionally add command line options with wildcards:

To exclude:

>vcs import --skip-fetch-branches "3_14_*|3_15_*" < .externals

To exclusive include:

>vcs import --checkout-branches "3_15_*|3_16_*" < .externals

Mixed (to rely on external fetch):

>vcs import --skip-fetch-branches '*' --checkout-branches "3_15_*|3_16_*" < .externals

Is there a chance to add this?

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

No branches or pull requests

1 participant