Skip to content
This repository has been archived by the owner on Dec 19, 2020. It is now read-only.

Allow submodules to be ignored by reading .gitmodule metadata #260

Merged
merged 2 commits into from
Sep 22, 2020

Conversation

mmjconolly
Copy link
Contributor

Allow a user to specify that a git submodule of a repository should not be considered as input to the dependency resolution algo, by adding a key/val pair to .gitmodules

$ cat workspace/foo/.gitmodules
[submodule "baa"]
    path = baa
    url = https://github.com/baa-corp/baa.git
    wit = ignore

Copy link
Collaborator

@jackkoenig jackkoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the docs and clever idea for ignoring, I didn't even considering trying to add metadata to the .gitmodules file. Do you know for sure that it's safe?

@mmjconolly
Copy link
Contributor Author

mmjconolly commented Sep 22, 2020

I like the docs and clever idea for ignoring, I didn't even considering trying to add metadata to the .gitmodules file. Do you know for sure that it's safe?

Reasonably confident that it's safe, the .gitmodules file is under the hood a git config format file (ie, section/key/val) that happens to be used for submodules.

I also did some manual tests that preserve/ignore the extra metadata:

  • added a new submodule after a previous one already had 'ignore'
  • update a submodule that has 'ignore'
  • git submodule status
  • git submodule foreach

Copy link
Member

@richardxia richardxia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and nice docs!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants