Skip to content

Add flag to clone a git repository recursive #95

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

Closed
wants to merge 4 commits into from
Closed

Add flag to clone a git repository recursive #95

wants to merge 4 commits into from

Conversation

sectore
Copy link

@sectore sectore commented Apr 28, 2018

to support git submodules.

I came across that issue while trying to update https://github.com/domenkozar/hie-nix to latest HIE. Because HIE is using submodules now, stack2nix was thrown an error about missing sources of submodules defined in stack-8.2.1.yaml or stack-8.2.1.yaml.

This PR will fix that issue.

@domenkozar
Copy link
Contributor

@jmitchell do you think we could merge this?

@domenkozar
Copy link
Contributor

Actually, I think there's a problem. We are first cloning git repository with submodules for master HEAD, then we checkout to another branch. But if another branch has different submodules, this will fail.

@sectore can you make submodule usage explicit command after checkout has been done?

@sectore
Copy link
Author

sectore commented May 7, 2018

can you make submodule usage explicit command after checkout has been done?

@domenkozar Which git command do have in mind? Some other command instead of using git clone _uri_ --recursive _dir_?

@domenkozar
Copy link
Contributor

Yes - git submodule update --init --recursive

@sectore
Copy link
Author

sectore commented May 17, 2018

@domenkozar Would git clone --recurse-submodules {GIT-REPO} {DIR} work as well?

This is equivalent to running git submodule update --init --recursive immediately after the clone is finished.

(^ https://git-scm.com/docs/git-clone#git-clone---recurse-submodulesltpathspec)

@sectore
Copy link
Author

sectore commented May 17, 2018

@domenkozar Or did you mean to run that git submodule ... command right after running git checkout https://github.com/sectore/stack2nix/blob/f95772fc762c5a0d9e3caded6ca5b98711fb85ad/src/Stack2nix/External/VCS/Git.hs#L38 ? I guess the latter, right?

sectore added 2 commits May 17, 2018 16:48
into support-git-recursive
@sectore
Copy link
Author

sectore commented May 17, 2018

@domenkozar 09a7af0 (not tested locally)

of github.com:input-output-hk/stack2nix into support-git-recursive
@sectore
Copy link
Author

sectore commented Jun 13, 2018

@jmitchell Friendly ping: Are you happy with that PR ^ or do you miss something? It would be great to have that PR in master... Thanks!

@domenkozar
Copy link
Contributor

There is some kind of a bug that causes domenkozar/hie-nix#13 (comment) - I will investigate tomorrow.

@puffnfresh
Copy link
Contributor

Should this just be the default behaviour?

@domenkozar
Copy link
Contributor

OK there's no bug in particular with this PR, but I've opened #103

@domenkozar domenkozar mentioned this pull request Jul 12, 2018
@jmitchell
Copy link
Contributor

Should this just be the default behaviour?

Unless there's some way we discover this could break other projects, that sounds good to me.

@domenkozar
Copy link
Contributor

Mainly need to check if it has performance implications.

@domenkozar
Copy link
Contributor

domenkozar commented Jul 22, 2018

Couldn't find a reason not to do handle submodules by default, so I opened #108

@domenkozar domenkozar closed this Jul 22, 2018
@domenkozar
Copy link
Contributor

Thank you @sectore for this work!

@sectore sectore deleted the support-git-recursive branch August 24, 2019 15:50
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

Successfully merging this pull request may close these issues.

4 participants