-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
get windows support locked down #14
Comments
At the moment there are three native shells on Windows: CMD, Powershell and Bash on Windows. Bash is probably irrelevant, because it is Linux and is already supported by scmpuff. I would like to help bring scmpuff to CMD and Powershell. How can I help? |
Hi @stereokai, excited for the help! In theory, adding new shells should be relatively simple: if you look at That said, I believe a very important precursor is getting the Integration Testing up and running via Appveyor, so we can see the effect of the changes as we develop (and I suspect we will see some minor bugs even in bash in windows as a result, since the tests will be running there for the first time). |
Next week I will try to translate the init script to Powershell. For the uninitiated, can you please help me figure out: eval "$(scmpuff expand -- "$SCMPUFF_GIT_CMD" "$@")";;
Cheers! Let's get this going :) |
@mroth can you help me out? :) |
@mroth I have the Powershell script nailed. I haven't actually tested it yet because I need to download Go and compile scmpuff first, but it should work. Remove-Item alias:\git
Remove-Item function:\git
$SCMPUFF_GIT_CMD = Get-Command git | Select-Object -ExpandProperty Definition
function git {
switch -regex -casesensitive($args[0]) {
"^(commit|blame|log|rebase|merge)$" {
& scmpuff expand -- $SCMPUFF_GIT_CMD $args
}
"^(checkout|diff|rm|reset)$" {
& scmpuff expand --relative -- $SCMPUFF_GIT_CMD $args
}
"^add$" {
& scmpuff expand -- $SCMPUFF_GIT_CMD $args
scmpuff_status
}
default {
& $SCMPUFF_GIT_CMD $args
}
}
} |
@mroth Alright I compiled the scmpuff command on my computer, got it running. When I'm running
|
Okay I have done some research into this and I have a solution. First I looked into ANSI colors support in Powershell and CMD. Before Windows 10, the built-in terminals did not support ANSI color codes. In 2015, Microsoft has added basic support to Windows 10 only, and it looks like this (excerpt from here): echo �[101;93m NORMAL FOREGROUND COLORS �[0m
echo ^<ESC^>[30m �[30mBlack�[0m (black)
echo ^<ESC^>[31m �[31mRed�[0m
echo ^<ESC^>[32m �[32mGreen�[0m
echo ^<ESC^>[33m �[33mYellow�[0m Then I looked for the part in your code where you printing output with color, ie.: return fmt.Sprintf(
" %s| %s%s%s",
colorMap[dark], colorMap[neu], diff, colorMap[rst],
) Using the constants from I have found an alternative: fatih/color is an actively maintained cross-platform color library fro Go. I guess it's time for some experimenting. |
Oh interesting! I hadn't thought about the color output being platform specific, but that makes sense. Switching to a library for the color code constants will also probably present an opportunity to clean up and restructure the output UI code (which is currently very influenced by being a port from scmbreeze). |
Alright. I don't think it's going to be that hard to do. Unfortunately I don't have a Mac to test on. I could submit a pull request with that color library and then you would pick up from there? By the way, I would definitely need some help translating the scmpuff_status script. |
BTW, what is the build command for scmpuff? would be good adding it to the docs. I guessed |
@mroth I used go-colorable and got However I couldn't get any When I'm doing |
Yeah, I think we should probably abstract switching to a color library into it's own PR. It can happen independently of the cross platform work
Actually, that's working correctly! scmpuff expand only should expand the numeric arguments into the filenames and return the results. E.g. replacing
This is going to be trickier since I don't have a Windows dev environment set up, but I think this places even more importance on getting AppVeyor continuous integration testing set up (which should probably also be it's own PR, as just getting it up and running with the existing bash environment will probably take a little doing). Once continuous integration is set up, it will be easier for us to test the changes since with every commit in a PR we'll see what works and what doesn't across all environments (I think there may be a little complexity getting the Aruba tests working properly on Windows too, so this is a task in itself! But one that will greatly benefit scmpuff even before we start adding new shells). What timezone are you in @stereokai ? If you would like, we could also do a pairing session via videoconference or something at some point to go over the architecture stuff if you want to get really involved in helping making all this happen! |
I'm on UTC+3
In the readme you said you don't need ruby to build, just develop :P |
Take a peek in the |
Do you want to create a https://gitter.im room for starters? Would be easier to coordinate through there |
This looks great but it was hard to figure out where the efforts ended up. Has someone created a clear set of steps for running this under Windows 10? |
No updates on this actual issue currently, but while cleaning up old issues wanted to reply to this publicly:
To add a link for people who might be looking for the Gitter room, which is located at: |
There probably isn't too much to do here, but it requires a greater understanding on my part of what a typical Windows git CLI environment looks like, so help from Windows developers is greatly requested.
Figuring out a Windows based integration testing environment is a good first step towards seeing what is broken and what isn't.
The text was updated successfully, but these errors were encountered: