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

Cannot clone repo on Windows #19

Open
celtic-coder opened this issue Aug 30, 2023 · 6 comments
Open

Cannot clone repo on Windows #19

celtic-coder opened this issue Aug 30, 2023 · 6 comments

Comments

@celtic-coder
Copy link

Hi Acmeism (@acmeism) / Ingy (@ingydotnet),

This in an excellent project! I am sure that many developers will find it useful. However, there appears to be a problem cloning the repo on Windows.

As per the "Getting the Data" section in the ReadMe, I tried the following command:

git clone https://github.com/acmeism/RosettaCodeData --single-branch --depth=1

The initial portion of the clone command worked, but it then failed with an invalid path error:

Cloning into 'RosettaCodeData'...
remote: Enumerating objects: 283863, done.
remote: Counting objects: 100% (283863/283863), done.
remote: Compressing objects: 100% (168129/168129), done.
remote: Total 283863 (delta 5568), reused 280218 (delta 5540), pack-reused 0
Receiving objects: 100% (283863/283863), 52.34 MiB | 3.61 MiB/s, done.

Resolving deltas: 100% (5568/5568), done.
error: invalid path 'Lang/11l/Sequence:-smallest-number-greater-than-previous-term-with-exactly-n-divisors'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

My guess for the failure is that the ":" is an invalid character in the Windows filesystem. Might it be possible to change a colon character in a filename to the valid "-" character instead?

Kind Regards,
Liam

@TheOneTrueGuy
Copy link

I too am running into this issue. Is anyone still working on this project? I noticed in the RosettaCode-pm project that provides services for this there was an update 10 months ago for 2023 but it looks like nothing in this repo has been updated in years and years.

@ingydotnet
Copy link
Member

https://github.com/acmeism/RosettaCodeData/commits/main/

The repo has been updated many times in the last year.
Last update was 5 days ago.

I recently got a Windows machine. I can look into this sometime soon.

@celtic-coder
Copy link
Author

Hi Ingy, (@ingydotnet),

This evening I retried the "git clone" command as noted above:

git clone https://github.com/acmeism/RosettaCodeData --single-branch --depth=1

The same error occurred, as in the previous attempt:

invalid path 'Lang/11l/Sequence:-smallest-number-greater-than-previous-term-with-exactly-n-divisors'

It is quite possible that there are many more "invalid path" errors due to the "colon" character in the pathname. So, it may take some work to resolve this issue.

Thanks for saying that you will take some time to look into this issue.

Kind Regards,
Liam

@ingydotnet
Copy link
Member

https://gist.github.com/ingydotnet/b4a1d20dc95490fa1d3c2a59b6758565

417 bad paths.

Should be pretty easy to not use :.

Can try to address manually.

$ find . -type d | grep : | while read -r p; do echo "$(dirname "$p")"; done | grep : | sort | uniq
./Task/Sequence:-nth-number-with-exactly-n-divisors
./Task/Sequence:-smallest-number-greater-than-previous-term-with-exactly-n-divisors
./Task/Sequence:-smallest-number-with-exactly-n-divisors

Only 3 dirs...

OK I ran

$ find . -type d | grep : | while read -r p; do echo "$(dirname "$p")"; done | grep : | sort | uniq | while read -r p; do git mv "$p" "${p//:/}"; done
$ find . -type f | grep : | while read -r p; do git mv "$p" "${p//:/}"; done
$ find . -type l | grep : | while read -r p; do git mv "$p" "${p//:/}"; done

possibly cleaner way but this is just a test.

No more paths with : although there are some broken symlinks.

I pushed to branch https://github.com/acmeism/RosettaCodeData/tree/remove-colons

@celtic-coder can you git clone --branch=remove-colons ... and report back if at least the clone works on windows.

If so I'll fix up the build tool properly.

Thanks for your patience :)

@celtic-coder
Copy link
Author

Hi Ingy, (@ingydotnet),

Thanks for making these changes! It will be a few days before I can get around to testing this.

When I have the opportunity, I will get back to you on this.

Kind regards,
Liam

@celtic-coder
Copy link
Author

Hi Ingy, (@ingydotnet),

I ran the following command:

git clone --single-branch --depth=1 --branch=remove-colons https://github.com/acmeism/RosettaCodeData

We now have a further example of an "invalid path" error:

error: invalid path 'Lang/Burlesque/Eulers-constant-0.5772...'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.

The two culprits with "multiple dots" in the filename appear to be:

Eulers-constant-0.5772...
Four-is-the-number-of-letters-in-the-...

These appear in both the "Lang" and "Task" sections.

Kind Regards,
Liam

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

No branches or pull requests

3 participants