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

feat(submodules): cloneSubmodules option #7498

Closed
wants to merge 8 commits into from

Conversation

JamieMagee
Copy link
Contributor

This includes a couple of changes:

  • Added a new boolean config option cloneSubmodules (Defaults to true to be a non-breaking change)
  • Update submodules using checkout instead of submdoule update --remote
  • Remove usage of simple-git silent() as it's deprecated

I wasn't able update a submodule using update-index and put the change in 'Changes not staged for commit'. I'm open to suggestions here. I have however changed the call from git submodule update --init --remote to a simple git checkout. The --remote flag updates the submodule to the latest commit at the remote, so there was a (very small chance) of a race condition here

Closes #7472

This includes a couple of changes:

- Added a new boolean config option cloneSubmodules (Defaults to `true` to be a non-breaking change)
- Update submodules using `checkout` instead of `submdoule update --remote`
- Remove usage of simple-git `silent()` as it's deprecated

I wasn't able update a submodule using `update-index` and put the change in 'Changes not staged for commit'. I'm open to suggestions here. I have however changed the call from `git submodule update --init --remote` to a simple `git checkout`. The `--remote` flag updates the submodule to the latest commit at the remote, so there was a (very small chance) of a race condition here

Closes #7472
@rarkins rarkins changed the title Improve handling of git submodules feat(submodules): improve handling of git submodules Oct 19, 2020
@rarkins rarkins changed the title feat(submodules): improve handling of git submodules feat(submodules): cloneSubmodules option Oct 19, 2020
lib/config/definitions.ts Outdated Show resolved Hide resolved
lib/manager/git-submodules/extract.ts Outdated Show resolved Hide resolved
JamieMagee and others added 2 commits October 25, 2020 15:00
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

Needs deconflicting, other LGTM. assuming you've done a lot real testing.

viceice
viceice previously approved these changes Oct 28, 2020
Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

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

Should we split these into separate PRs in case one part doesn't work?

@@ -106,7 +106,8 @@ export default async function extractPackageFile(
try {
const [currentValue] = (await git.subModule(['status', path]))
.trim()
.split(/[+\s]/);
.replace(/^[-+]/, '')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this fixing any open issue or just something you discovered?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There isn't an open issue for this, but it does fix a bug

@viceice
Copy link
Member

viceice commented Oct 30, 2020

@JamieMagee lets split this pr.

@viceice viceice marked this pull request as draft October 30, 2020 18:29
@JamieMagee
Copy link
Contributor Author

Okay, will create new PRs, and abandon this one.

JamieMagee added a commit that referenced this pull request Nov 4, 2020
This is part 1 of #7498, and includes:

- Added a new boolean config option cloneSubmodules (Defaults to `true` to be a non-breaking change)
JamieMagee added a commit that referenced this pull request Nov 4, 2020
This is part 3 of #7498, and includes:

- Correctly parse git submodule name
@JamieMagee JamieMagee closed this Nov 4, 2020
@JamieMagee JamieMagee deleted the feat/git-submodules branch November 4, 2020 08:53
rarkins pushed a commit that referenced this pull request Nov 4, 2020
This is part 3 of #7498, and includes:

- Correctly parse git submodule name
viceice pushed a commit that referenced this pull request Nov 4, 2020
This is part 3 of #7498, and includes:

- Correctly parse git submodule name
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2020
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.

git submodules do not need to be initialized in order to be updated
4 participants