gitman icon indicating copy to clipboard operation
gitman copied to clipboard

Add `recurse` option in config

Open brandonaut opened this issue 5 years ago • 5 comments

To avoid recursive clones when there are circular dependencies, gitman install --depth 1 can be used. However, this is risky as it requires the user to add it on every gitman install call. It would be nice to have a recurse field in gitman.yml to provide a little more control.

For example:

location: gitman_sources
sources:
  - name: mydep
    type: git
    repo: https://someurl.com/mydep.git
    recurse: false  # Don't process the gitman.yml in the mydep repo
    sparse_paths:
      -
    rev: master
    link:
    scripts:
      -
groups:
  -

brandonaut avatar Dec 01 '20 23:12 brandonaut

Do you have a use case for circular dependencies?

jacebrowning avatar Dec 01 '20 23:12 jacebrowning

My particular use case is for avoiding circular dependencies (which admittedly, is bad practice to begin with). However, I think the recurse field would be useful just as a way of controlling whether to pull another level of dependencies, whether they're circular or not.

As an aside: I suppose the ——depth CLI flag should override the recurse field, if they both are used.

brandonaut avatar Dec 01 '20 23:12 brandonaut

Yeah, I'm just trying to understand how common this situation is to warrant a feature to prevent it. 😄

jacebrowning avatar Dec 01 '20 23:12 jacebrowning

I see some overlap to #128

daniel-brosche avatar Dec 02 '20 11:12 daniel-brosche

Good point @daniel-brosche. I think that resolve: flat would meet my need here. This issue can probably be closed in favor of that.

brandonaut avatar Dec 02 '20 20:12 brandonaut