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

Fix clean of submodules #2168

Closed
wants to merge 1 commit into from
Closed

Fix clean of submodules #2168

wants to merge 1 commit into from

Conversation

geaaru
Copy link

@geaaru geaaru commented May 20, 2019

Fix execution with the vendor with submodules.

What does this do / why do we need it?

This fix error:

#$# dep ensure -add github.com/openSUSE/umoci
Fetching sources...

Solving failure: No versions of github.com/openSUSE/umoci met constraints:
	v0.3.1: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.4.4: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.4.3: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.4.2: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.4.1: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.4.0: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.3.0: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.2.1: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.2.0: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.1.0: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.0.0: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.0.0-rc3: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.0.0-rc2: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	v0.0.0-rc1: Could not introduce github.com/openSUSE/[email protected], as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

	master: unexpected error while defensively cleaning up after possible derelict nested submodule directories: Entering '.site/themes/hugo-theme-learn'
error: unknown switch `x'
uso: git submodule--helper foreach [--quiet] [--recursive] <command>

    -q, --quiet           Suppress output of entering each submodule command
    --recursive           Recurse into nested submodules

fatal: run_command returned non-zero status while recursing in the nested submodules of .site/themes/hugo-theme-learn
.
: command failed: [git submodule foreach --recursive git clean -x -d -f -f]: exit status 128
	gh-pages: Could not introduce github.com/openSUSE/umoci@gh-pages, as it is not allowed by constraints from the following projects:
	master from (root)
	master from github.com/geaaru/docker-companion@master

@geaaru geaaru requested a review from jmank88 as a code owner May 20, 2019 21:46
@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@geaaru
Copy link
Author

geaaru commented May 20, 2019

I signed it!

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link
Collaborator

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@kevinburke
Copy link
Collaborator

Hey, I can't reproduce this issue, can you describe what you did to test this change? I'm a little confused because you should be able to write the command with spaces in between, after the "foreach" instead of needing to list it all as one command.

Maybe we need a "--" ?

@aaronjwood
Copy link

I never used to hit this in my projects that have submodules but I hit it now. The only thing that has changed on my end is my git version. I upgraded git via brew a few days ago:

$ git --version
git version 2.22.0

My dep version hasn't changed:

$ dep version
dep:
 version     : v0.5.3
 build date  : 2019-05-19
 git hash    : 192eb44
 go version  : go1.12.5
 go compiler : gc
 platform    : darwin/amd64
 features    : ImportDuringSolve=false

@geaaru
Copy link
Author

geaaru commented Jun 13, 2019

Hi,

in my case I have:

$ git --version
git version 2.21.0

@geaaru
Copy link
Author

geaaru commented Jun 13, 2019

You could reproduce it directly with git and the repository that I wrote:

$# git clone https://github.com/openSUSE/umoci.git
$# git submodule foreach --recursive git clean -x -d -f -f
Entering '.site/themes/hugo-theme-learn'
error: unknown switch `x'

$# # right way with avoid use of clean option directly
$# git submodule foreach --recursive "git clean -x -d -f -f"
Entering '.site/themes/hugo-theme-learn'

In summary, if you avoid assembling the git clean options then the options are seen as git submodule options and this break the execution.

@kevinburke
Copy link
Collaborator

OK

1 similar comment
@kevinburke
Copy link
Collaborator

OK

kevinburke pushed a commit that referenced this pull request Jun 13, 2019
Previously, the "-x" in

    git submodule foreach --recursive git clean -x

was being applied to the "git submodule" command not the "git clean"
command. git submodule foreach expects the inner command to be wrapped
in a single string, so pass git clean as a single string.

Verified this works as expected on the command line.

Fixes #2164.
Fixes #2168.
kevinburke added a commit that referenced this pull request Jun 13, 2019
Previously, the "-x" in

    git submodule foreach --recursive git clean -x

was being applied to the "git submodule" command not the "git clean"
command. git submodule foreach expects the inner command to be wrapped
in a single string, so pass git clean as a single string.

Verified this works as expected on the command line.

Originally submitted as #2164 by Daniele Rodina
<[email protected]>, re-submitted by me to amend the commit and
merge immediately.

Fixes #2164.
Fixes #2168.
kevinburke added a commit that referenced this pull request Jun 13, 2019
Previously, the "-x" in

    git submodule foreach --recursive git clean -x

was being applied to the "git submodule" command not the "git clean"
command. git submodule foreach expects the inner command to be wrapped
in a single string, so pass git clean as a single string.

Verified this works as expected on the command line.

Originally submitted as #2164 by Daniele Rodina
<[email protected]>, re-submitted by me to amend the commit and
merge immediately.

Fixes #2164.
Fixes #2168.
kevinburke added a commit that referenced this pull request Jun 13, 2019
Previously, the "-x" in

    git submodule foreach --recursive git clean -x

was being applied to the "git submodule" command not the "git clean"
command. git submodule foreach expects the inner command to be wrapped
in a single string, so pass git clean as a single string.

Verified this works as expected on the command line.

Originally submitted as #2164 by Daniele Rodina
<[email protected]>, re-submitted by me to amend the commit and
merge immediately.

Fixes #2164.
Fixes #2168.
Sayan- pushed a commit to Clever/dev-handbook that referenced this pull request Jul 16, 2019
we need the fix for submodules
golang/dep#2168
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants