-
Notifications
You must be signed in to change notification settings - Fork 271
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
Fixes for Git for Windows's Git Bash #119
Comments
I can look into this one today. I have Git for Windows's Git Bash set up locally. I think it should be easy. |
Just ran the tests. Good news, all code compiles and tests actually run.
works. Bad news: lots of test failures. Hopefully this is all caused by something simple. Will dig deeper later. |
Ran into this: https://gist.github.com/ingydotnet/cbcac5bb4c1886fb9606 Can anyone confirm or deny if this is a bug in Bash? |
I'm not a bash expert, but if I understand this http://www.tldp.org/LDP/abs/html/comparison-ops.html correctly, it's a feature
|
@perlpunk Your example has literal matching chars. I guess variable expansion happens and leads to this (buggy imho) behavior. From the manpage:
|
I thought $variable expansion inside double brackets was safe (ie quotes not needed). I'll have to go back and add quotes. |
@ingydotnet ok, that might explain why in zsh I get no output for all six commands. |
just tested, behavior still the same in bash 4.4-beta |
See alo #38 |
I am testing this (git version 2.7.0.windows.1) at home on my windows machine and this appeared:
I tested and updated And then I got:
Will look into this further later tonight, but if anyone has any clues they are welcome :-) |
Lets have another go:
Then the problem that you discussed above kicked in:
But after that it gets somewhere:
Running the tests will still give me a lot of errors: I'll start with checking the:
It seems that as I am running git bash and emacs so I can use:
|
This problem comes back as the test sources the lib/git-subrepo.d/bash+.bash
Don't know the meaning of the extra source step so I leave this for now. |
It seems that git converts paths as well:
Investigating why and if this can be handled someway |
@grimmySwe, The problems that you are having are a result of Windows symlinks. We could put this logic into Thanks for digging in more. I'd put this on hold... |
I have the tests passing
I have installed babun and using zsh (There is an option to use bash but that couldn't cope with the .rc) First issue was line endings. As the repo must be used with LF endings, and Windows needs a different setting in general terms, there should be a .gitattributes file in the repo with In I don't get the quoting issue. And its a pretty shell :) Now to actually use it! |
I tried a different shell - supplied with SourceTree - mingw32 bash shell
babun is:
It gets no errors now, but 'does nothing' with debug on its failing at this test just before calling main: whereas in babun this is the test:
I then changed babun to use the same git as mingw32, and now it behaves the same - it does nothing. Of course all other git commands work fine. |
I tested a little more and came across a strange error:
But if I run the commands manually it works... Also tested to put in It seems that if I do this in test/setup it works: |
So I got almost all tests working in gitbash. Created issue/119 branch for this. There are some code commented out that I haven't been able to test it on linux/mac so please let me know if you find problems. |
I have been looking for a submodule alternative and I admit this is very promising! Hopefully your work will find its way into the main git program. The master branch did not work for me (with that weird bash+ issue), but the issue/119 does. Will try out your script now 👍 Thank you for caring about the Windows world, btw. EDIT: wow... I used some "git subrepo pull --all" command and it destroyed my codebase... :/ |
@robe070 @grimmySwe have you guys pushed your work somewhere so I can test it OK I just found https://github.com/ingydotnet/git-subrepo/commits/issue/119 I'll try installing these shells tonight and see how far I can get. @quiret can you explain what 'destroyed my codebase' means, specifically? |
@robe070, I think babun is just simpler packaging/tooling around cygwin. AFAIK, subrepo has always worked on cygwin. (I'm glad it still does) re "I tried a different shell - supplied with SourceTree - mingw32 bash shell" Can you provide a URL (or other instructions) of where you got this environment I'm working on testing this on all the windows permutations I can find. |
@ingydotnet & @grimmySwe , I was just about to reply about my tests on Windows in MINGW32. It seems to be working, when it wasn't before I applied the changes from @grimmySwe. But I can't run the subrepo tests as the environment does not ship SourceTree is from Atlassian. You can download it from here: https://www.sourcetreeapp.com/ Click on Terminal on the toolbar. It would be great if you could confirm it passes the tests, and inform me how you got make installed - it crashed when I installed MSYS. I ran the tests in the babun zsh shell and some of them failed. The results are here: https://gist.github.com/robe070/7d2314e7e88d3b8d7f85 Babun uses an older Git ( |
Update on running tests in SourceTree MINGW32 I bypassed Most tests passed. The same failures as with babun The results are here: https://gist.github.com/robe070/7d2314e7e88d3b8d7f85 |
I've also been looking for a solution to the problems with git submodules and subtrees for some time and git subrepo sounds like a great solution to me. But we use a Windows environment so I can't test it out yet. I don't know enough about bash to help solve this problem, but I just wanted to encourage you to keep chipping away at this issue for the benefit of the rest of us. |
Actually the code in and the git version included with it is: I also use SourceTree and Git Extensions. I was able to tell both of them to use the updated bash and git that came with Git for Windows instead of using the outdated bash that is bundled with SourceTree. Then If I use the Is it safe for me to start using this branch of |
@grimmySwe I took your issue/119 branch, rebased with master, add a few commits of my own and pushed it back. Can you test on Git for Windows. If tests pass or mostly pass please gist this command output:
and comment the url for the gist. I can't get the tests to pass at all yet, but I think my env might be messed up, or not set up like yours. |
I am declaring that subrepo works on Windows! I've updated the docs with some windows specific info. All tests pass on Git for Windows with: git config --global core.autocrlf input Closing this. Reopen if needed. |
All tests passing on Babun too. Can someone test out Cygwin. I don't have the |
I doubled checked and all tests pass for me on in my git bash. |
I'm thinking this is release worthy. Looking over other issues to close... |
I'm loathe to re-open but I think requiring that a config setting is used which is not recommended for Windows is not optimal. That is, I've not included the recent changes yet, but issue/119 changes seem to work for me. I use This is not the same as autocrlf=input and there is no equivalent that I can find for .gitattributes. A few tests fail, I believe due to CRLF being used by the test and then it being forced to LF by git Neither does it seem optimal to require a repo config setting: LF line endings are definitely required. Why not include a .gitattributes file? I neither know git very well nor do I have a Linux environment to test on. If someone created a .gitattributes like I've suggested and then added exceptions for the readme files, and whatever else ON LINUX, and got that working, it would work on Windows too. Tests included. Anyone put their hand up? |
@robe070 I'll try |
thats great! (I hope encouragement is not discouraged 👍 ) I'm giving tag github/issue/119 a test right now |
I'm getting a lot of these warnings:
Only 3 tests failed and I got a fix for one of them. I wonder if it's possible to have the |
Those messages are probably the same as the ones I'm getting. I believe it is possible to have I'm using |
Test failed.
|
All tests pass for People should be able to use this (and run tests) on Windows now, without any Still getting warnings on issue95.t and issue96.t. Will fix that at some point. @robe070, please test and confirm. Also still need someone to run tests on |
When I had With old changes...
|
Tested 9f2ab87 - master as at 2/3/2016 12:16:25 PM AEST
All tests pass on both 32 bit and 64 bit Git for Windows (MingW)
Thanks @ingydotnet ! |
@robe070 you are welcome! I'm sure there are bugs lurking, but if all the tests pass on a stock install, then what more can be done? :) The approach I took was use So basically making the tests run in a posix-ish environment. I suppose that leaves a lot of room for things to be weird in Windows dev and in cross dev. We shall see... we shall fail... we shall fix... |
Line ending differences are a fact of life in Windows development. We have a cross platform project with some files that must be crlf in both windows and Linux, and some that must be lf on both os. Seems like subrepo required no logic changes for windows. It was all about making it compatible with the variants of bash and allowing for line ending differences especially in tests. I've used it extensively for the last week - at least I've used init and clone a lot! Just starting some push/pull tests. Warm regards Rob Goodridge On 3 Mar 2016, at 1:47 AM, Ingy döt Net notifications@github.com wrote: @robe070 you are welcome! I'm sure there are bugs lurking, but if all the tests pass on a stock install, then what more can be done? :) The approach I took was use .gitattributes file you suggested in the main repo. and also in one of the tests that creates a repo. Then I set git config core.autocrlf input (not --global) in the test/setup file, so the test suite is always running under that. Then I had to do the same thing for the tests that clone a fake repo. So basically making the tests run in a posix-ish environment. I suppose that leaves a lot of room for things to be weird in Windows dev and in cross dev. We shall see... we shall fail... we shall fix... — |
Don't know if this is common knowledge but running git on windows might be quite slow, so there are some improvements: |
@grimmySwe thanks for that. We should play around with those things and adjust the code and/or docs accordingly. |
It might be worth adding a note under Windows installation, for those like my that don't have quite as good an understanding of bash, that .bashrc isn't read but .bash_profile instead. |
From #116 Christophe Porteneuve asks:
Apparently it doesn't work yet in Git for Windows's Git Bash. It's been updated
recently to a much more recent Bash and Git. Is that scheduled soon?
The text was updated successfully, but these errors were encountered: