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

nix-prefetch-git: Fix git submodule checkout #552

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

joranvar
Copy link

When fetching git submodules, nix-prefetch-git would fail on line 160 with "cd: too many arguments". I'm not sure if the git submodule status output has changed, or whether init_submodules() is called in different situations where it does work. But this change works for me (the submodule is checked out correctly), so it may benefit someone else as well.

Separate git submodule dir from git describe part when parsing

Ignore first character of git submodule status output
The submodule may possibly already be initialized, thus lacking the
initially expected dash (-).

The submodule may possibly already be initialized, thus lacking the
initially expected dash (`-`).
@aycanirican
Copy link
Member

@joranvar This worked like a charm, thank you. cc @edolstra

@wavewave
Copy link

wavewave commented Apr 9, 2018

👍

Otherwise, the first '.' might match the first character of the hash,
if the submodule status line starts with just a space (which may get
lost in the bash variable processing).
@joranvar
Copy link
Author

I ran into an issue today where the complete commit hash was needed. As the skipped character may not be just white space (it may get trimmed off by bash), I constrained the skipping to just the expected non-hash characters. Hope it still works for you!

@jokogr
Copy link

jokogr commented Apr 17, 2018

I have tested this PR, too, and it seems to be working properly, thanks!

@kquick
Copy link
Contributor

kquick commented Jun 30, 2018

With all due respect to this solution from @joranvar, I have just submitted #570 which is a superset of this PR, fixing some other issues in nix-prefetch-get by taking a bit of a different approach. I would appreciate confirmation from anyone that tested this PR (#552) that #570 also resolves the issues they encountered. Thanks!

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.

None yet

5 participants