-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Normalizes path for git and git submodules #73
Conversation
78cec61
to
74eeda7
Compare
`_git_ls_files()` returns file paths with forward slashes. For files in submodules, add_prefix_to_each() is called to prefix all the submodule files with the relative path to the project root. On Windows, the relative path contains backslashes. Since not every file in the project is in a submodule, the combined list of files ended up with some files that use forward slashes and others that use backslashes. For project structures where the submodules share a path segment with the project source, this caused `add_directories()` to create duplicate directory entries in the list of files. The duplicate entries would result in a traceback with a WindowsError when `os.mkdir()` was called to create the same directory a second time. See mgedmin#61 for more details. This commit ensures the list of files contains only forward slashes before calling `add_directories()`, eliminating the duplicate directory entries.
74eeda7
to
c035e23
Compare
Normalizing slashes and backslashes internally seems like a great idea. I also want to have a regression test for this issue. I can write one, but I'd appreciate some help distilling #61 (comment) into a sequence of commands I could run on Windows to reproduce this. |
Will pseudo-commands work well enough? I can take another look at the tests later this afternoon, also.
|
https://github.com/mgedmin/check-manifest/blob/master/tests.py#L942-L966 is the current test for submodules, and I see that all the submodules I've added are at the top level of each respective repository. Let me see what Appveyor will say if I move one of those into a subdir. |
This might suffice as a regression test for #73.
Appveyor sees duplicate entries in the list! Let me now try your patch on top of this new test. |
That's some neat git- and ci-foo there. Will need to remember that trick. |
Ok, Appveyor shows success (although GitHub stopped showing me CI status because computers |
This might suffice as a regression test for #73.
I'll cut a release after I see that my Jenkins is also happy (sometimes it breaks when Appveyor is fine, and sometimes Appveyor breaks when my Jenkins is fine, and everything is terrible). Jenkins builds take 25 minutes on Windows for some reason (because git is slooooow on Windows? but not on Appveyor? because the git I have in my VM is older? I don't know!). |
Right on. Git for Windows has been a pretty amazing project lately... probably worth trying a newer version if you're running something older. |
Maybe add a |
The git I've got on my Jenkins is version 1.8.4.msysgit.0. I can download a newer release and try to install, and then it complains that C:\Git already exists and doesn't seem to know anything about the concept of upgrading existing software and 🔥 🔥 🔥 this is why I never upgrade stuff on Windows where is my apt-get? |
Oh man, yeah, that version is ancient! 😛 Git-for-Windows made a pretty big switch away from msysgit last year (I think). Should (probably) not run into similar upgrade issues using the newer versions... (One hopes...) |
Ooh, in Add/Remove programs the version is even more fun: 1.8.4-preview20130916. I'll wait for the build to complete, uninstall then install a new version (and hope this won't wipe my ~/.bashrc and other customizations). |
Whoops, this digression belongs in the comments of #63. |
check-manifest 0.33 is out on PyPI! |
🎆 🏆 |
_git_ls_files()
returns file paths with forward slashes. For filesin submodules, add_prefix_to_each() is called to prefix all the
submodule files with the relative path to the project root. On Windows,
the relative path contains backslashes. Since not every file in the
project is in a submodule, the combined list of files ended up with
some files that use forward slashes and others that use backslashes.
For project structures where the submodules share a path segment with
the project source, this caused
add_directories()
to create duplicatedirectory entries in the list of files. The duplicate entries would
result in a traceback with a WindowsError when
os.mkdir()
was calledto create the same directory a second time.
See #61 for more details.
This commit ensures the list of files contains only forward slashes
before calling
add_directories()
, eliminating the duplicate directoryentries.