[ANN] Windows support for GitFileTree
Hi all, thanks to the help of Nicolai and Levente (and others), GitFileTree has now working support for Windows users through ProcessWrapper (on the development versions). A way for it to work is to have git in your path and simply load: Metacello new configuration: 'GitFileTree'; version: #'development'; repository: 'https://smalltalkhub.com/mc/Pharo/MetaRepoForPharo50/main'; load Expect this to move into stable GitFileTree if it is reported to work. Next steps for gitfiletree are a metadata-less mode (for Alexandre :)) and svn support (aka SVNFileTree ;)). Regards, Thierry
:-) Excellent! Alexandre
On Oct 9, 2015, at 6:35 PM, Thierry Goubier <thierry.goubier@gmail.com> wrote:
Hi all,
thanks to the help of Nicolai and Levente (and others), GitFileTree has now working support for Windows users through ProcessWrapper (on the development versions).
A way for it to work is to have git in your path and simply load:
Metacello new configuration: 'GitFileTree'; version: #'development'; repository: 'https://smalltalkhub.com/mc/Pharo/MetaRepoForPharo50/main'; load
Expect this to move into stable GitFileTree if it is reported to work.
Next steps for gitfiletree are a metadata-less mode (for Alexandre :)) and svn support (aka SVNFileTree ;)).
Regards,
Thierry
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hi Thierry, Providing some feedback here. I couldn't add a remote repository (image hangs) using Pharo 5. Working with GitHub Bash and SSH connections I think one needs to re-use ssh-agent environment variables before launching git commands. For example if ssh-agent.exe was sucessfully started and MSYS says: $ env | grep ^SSH SSH_AGENT_PID=5784 SSH_AUTH_SOCK=/tmp/ssh-Jpgwx10860/agent.10860 then from CMD.exe one could get both values using: C:\> wmic process where ExecutablePath='c:\\Program Files (x86)\\Git\\bin\\ssh-agent.exe' get ProcessId C:\> find /tmp/ssh-* -name agent.\* -uid $(id -u)|head -n 1 I have attached a change set with some refactorings and new methods to enable setting ssh-agent variables. It is not finished and it needs review. I do not have too much time but is a start, I hope. Cheers, Hernán 2015-10-09 18:35 GMT-03:00 Thierry Goubier <thierry.goubier@gmail.com>:
Hi all,
thanks to the help of Nicolai and Levente (and others), GitFileTree has now working support for Windows users through ProcessWrapper (on the development versions).
A way for it to work is to have git in your path and simply load:
Metacello new configuration: 'GitFileTree'; version: #'development'; repository: ' https://smalltalkhub.com/mc/Pharo/MetaRepoForPharo50/main'; load
Expect this to move into stable GitFileTree if it is reported to work.
Next steps for gitfiletree are a metadata-less mode (for Alexandre :)) and svn support (aka SVNFileTree ;)).
Regards,
Thierry
Hi Hernà n, I'm not familiar with the use of ssh-agent. Could it interfere with someone using his own keys (i.e. without ssh-agent)? Would this be necessary for linux or mac use of ssh-agent, or is ssh / git correctly done on those platforms to query ssh-agent on its own if it is already running? Anyway, I'll integrate that. Thierry Le 13/10/2015 06:19, Hernán Morales Durand a écrit :
Hi Thierry,
Providing some feedback here.
I couldn't add a remote repository (image hangs) using Pharo 5. Working with GitHub Bash and SSH connections I think one needs to re-use ssh-agent environment variables before launching git commands. For example if ssh-agent.exe was sucessfully started and MSYS says:
$ env | grep ^SSH SSH_AGENT_PID=5784 SSH_AUTH_SOCK=/tmp/ssh-Jpgwx10860/agent.10860
then from CMD.exe one could get both values using:
C:\> wmic process where ExecutablePath='c:\\Program Files (x86)\\Git\\bin\\ssh-agent.exe' get ProcessId
C:\> find /tmp/ssh-* -name agent.\* -uid $(id -u)|head -n 1
I have attached a change set with some refactorings and new methods to enable setting ssh-agent variables. It is not finished and it needs review. I do not have too much time but is a start, I hope.
Cheers,
Hernán
2015-10-09 18:35 GMT-03:00 Thierry Goubier <thierry.goubier@gmail.com <mailto:thierry.goubier@gmail.com>>:
Hi all,
thanks to the help of Nicolai and Levente (and others), GitFileTree has now working support for Windows users through ProcessWrapper (on the development versions).
A way for it to work is to have git in your path and simply load:
Metacello new configuration: 'GitFileTree'; version: #'development'; repository: 'https://smalltalkhub.com/mc/Pharo/MetaRepoForPharo50/main'; load
Expect this to move into stable GitFileTree if it is reported to work.
Next steps for gitfiletree are a metadata-less mode (for Alexandre :)) and svn support (aka SVNFileTree ;)).
Regards,
Thierry
On Tue, Oct 13, 2015 at 8:11 AM, Thierry Goubier <thierry.goubier@gmail.com> wrote:
Hi Hernà n,
I'm not familiar with the use of ssh-agent. Could it interfere with someone using his own keys (i.e. without ssh-agent)? Would this be necessary for linux or mac use of ssh-agent, or is ssh / git correctly done on those platforms to query ssh-agent on its own if it is already running?
I'm using ssh-agent on both windows and linux, and having aforementioned variables (SSH_AGENT_PID, SSH_AUTH_SOCK) in the environment is enough for git to automatically use it, no need to prefix it. In any case I have notes about the implementation: 1. it assumes that it runs only on windows (it looks like this should be generic code) 2. it assumes that ssh-agent will be always installed in a specific path, it should rely on PATH instead 3: Windows has its own system for global env variables, so why not use that? So instead of doing some process lookups you simply get $Env:SSH_AUTH_SOCK" (well, I use powershell... but the bat version is I think %SSH_AUTH_SOCK%) Peter
2015-10-13 9:29 GMT+02:00 Peter Uhnák <i.uhnak@gmail.com>:
On Tue, Oct 13, 2015 at 8:11 AM, Thierry Goubier < thierry.goubier@gmail.com> wrote:
Hi Hernà n,
I'm not familiar with the use of ssh-agent. Could it interfere with someone using his own keys (i.e. without ssh-agent)? Would this be necessary for linux or mac use of ssh-agent, or is ssh / git correctly done on those platforms to query ssh-agent on its own if it is already running?
I'm using ssh-agent on both windows and linux, and having aforementioned variables (SSH_AGENT_PID, SSH_AUTH_SOCK) in the environment is enough for git to automatically use it, no need to prefix it.
This is what I expected. Is that different under Windows?
In any case I have notes about the implementation:
1. it assumes that it runs only on windows (it looks like this should be generic code)
Well, as you said above, the environment under Linux/Mac takes care of the interaction with ssh-agent... so there is no need to handle that on the Linux/Mac side (OSProcess) versus Windows (ProcessWrapper).
2. it assumes that ssh-agent will be always installed in a specific path, it should rely on PATH instead
Noted.
3: Windows has its own system for global env variables, so why not use that? So instead of doing some process lookups you simply get $Env:SSH_AUTH_SOCK" (well, I use powershell... but the bat version is I think %SSH_AUTH_SOCK%)
But the thing is: if I can query for environment variables in Windows, then so can the git command as well, which would mean it would pick-up the use of ssh-agent, no? Or should I try to manipulate the process Anyway, I appreciate you're having a look at it. Thanks! Thierry
Peter
Would the SSH package in Cryptography help you? thanks, Robert On 10/13/2015 03:36 AM, Thierry Goubier wrote:
2015-10-13 9:29 GMT+02:00 Peter Uhnák <i.uhnak@gmail.com <mailto:i.uhnak@gmail.com>>:
On Tue, Oct 13, 2015 at 8:11 AM, Thierry Goubier <thierry.goubier@gmail.com <mailto:thierry.goubier@gmail.com>> wrote:
Hi Hernà n,
I'm not familiar with the use of ssh-agent. Could it interfere with someone using his own keys (i.e. without ssh-agent)? Would this be necessary for linux or mac use of ssh-agent, or is ssh / git correctly done on those platforms to query ssh-agent on its own if it is already running?
I'm using ssh-agent on both windows and linux, and having aforementioned variables (SSH_AGENT_PID, SSH_AUTH_SOCK) in the environment is enough for git to automatically use it, no need to prefix it.
This is what I expected. Is that different under Windows?
In any case I have notes about the implementation:
1. it assumes that it runs only on windows (it looks like this should be generic code)
Well, as you said above, the environment under Linux/Mac takes care of the interaction with ssh-agent... so there is no need to handle that on the Linux/Mac side (OSProcess) versus Windows (ProcessWrapper).
2. it assumes that ssh-agent will be always installed in a specific path, it should rely on PATH instead
Noted.
3: Windows has its own system for global env variables, so why not use that? So instead of doing some process lookups you simply get $Env:SSH_AUTH_SOCK" (well, I use powershell... but the bat version is I think %SSH_AUTH_SOCK%)
But the thing is: if I can query for environment variables in Windows, then so can the git command as well, which would mean it would pick-up the use of ssh-agent, no? Or should I try to manipulate the process
Anyway, I appreciate you're having a look at it. Thanks!
Thierry
Peter
2015-10-13 9:46 GMT+02:00 Robert Withers <robert.w.withers@gmail.com>:
Would the SSH package in Cryptography help you?
I don't know. I just delegate to git for handling the ssh stuff; Pharo has little to gain by manipulating ssh by itself in that use case (but, overalll, I believe ssh support to be usefull). I'll have a look. Thierry
thanks, Robert
On 10/13/2015 03:36 AM, Thierry Goubier wrote:
2015-10-13 9:29 GMT+02:00 Peter Uhnák <i.uhnak@gmail.com <mailto:i.uhnak@gmail.com>>:
On Tue, Oct 13, 2015 at 8:11 AM, Thierry Goubier <thierry.goubier@gmail.com <mailto:thierry.goubier@gmail.com>> wrote:
Hi Hernà n,
I'm not familiar with the use of ssh-agent. Could it interfere with someone using his own keys (i.e. without ssh-agent)? Would this be necessary for linux or mac use of ssh-agent, or is ssh / git correctly done on those platforms to query ssh-agent on its own if it is already running?
I'm using ssh-agent on both windows and linux, and having aforementioned variables (SSH_AGENT_PID, SSH_AUTH_SOCK) in the environment is enough for git to automatically use it, no need to prefix it.
This is what I expected. Is that different under Windows?
In any case I have notes about the implementation:
1. it assumes that it runs only on windows (it looks like this should be generic code)
Well, as you said above, the environment under Linux/Mac takes care of the interaction with ssh-agent... so there is no need to handle that on the Linux/Mac side (OSProcess) versus Windows (ProcessWrapper).
2. it assumes that ssh-agent will be always installed in a specific path, it should rely on PATH instead
Noted.
3: Windows has its own system for global env variables, so why not use that? So instead of doing some process lookups you simply get $Env:SSH_AUTH_SOCK" (well, I use powershell... but the bat version is I think %SSH_AUTH_SOCK%)
But the thing is: if I can query for environment variables in Windows, then so can the git command as well, which would mean it would pick-up the use of ssh-agent, no? Or should I try to manipulate the process
Anyway, I appreciate you're having a look at it. Thanks!
Thierry
Peter
I just took a quick look. It depends on both LayeredProtocol and SSL, but SSL won't load as HierarchicalUrl is missing. thanks, Robert On 10/13/2015 04:02 AM, Thierry Goubier wrote:
2015-10-13 9:46 GMT+02:00 Robert Withers <robert.w.withers@gmail.com <mailto:robert.w.withers@gmail.com>>:
Would the SSH package in Cryptography help you?
I don't know. I just delegate to git for handling the ssh stuff; Pharo has little to gain by manipulating ssh by itself in that use case (but, overalll, I believe ssh support to be usefull).
I'll have a look.
Thierry
thanks, Robert
On 10/13/2015 03:36 AM, Thierry Goubier wrote:
2015-10-13 9:29 GMT+02:00 Peter Uhnák <i.uhnak@gmail.com <mailto:i.uhnak@gmail.com> <mailto:i.uhnak@gmail.com <mailto:i.uhnak@gmail.com>>>:
On Tue, Oct 13, 2015 at 8:11 AM, Thierry Goubier <thierry.goubier@gmail.com <mailto:thierry.goubier@gmail.com> <mailto:thierry.goubier@gmail.com <mailto:thierry.goubier@gmail.com>>> wrote:
Hi Hernà n,
I'm not familiar with the use of ssh-agent. Could it interfere with someone using his own keys (i.e. without ssh-agent)? Would this be necessary for linux or mac use of ssh-agent, or is ssh / git correctly done on those platforms to query ssh-agent on its own if it is already running?
I'm using ssh-agent on both windows and linux, and having aforementioned variables (SSH_AGENT_PID, SSH_AUTH_SOCK) in the environment is enough for git to automatically use it, no need to prefix it.
This is what I expected. Is that different under Windows?
In any case I have notes about the implementation:
1. it assumes that it runs only on windows (it looks like this should be generic code)
Well, as you said above, the environment under Linux/Mac takes care of the interaction with ssh-agent... so there is no need to handle that on the Linux/Mac side (OSProcess) versus Windows (ProcessWrapper).
2. it assumes that ssh-agent will be always installed in a specific path, it should rely on PATH instead
Noted.
3: Windows has its own system for global env variables, so why not use that? So instead of doing some process lookups you simply get $Env:SSH_AUTH_SOCK" (well, I use powershell... but the bat version is I think %SSH_AUTH_SOCK%)
But the thing is: if I can query for environment variables in Windows, then so can the git command as well, which would mean it would pick-up the use of ssh-agent, no? Or should I try to manipulate the process
Anyway, I appreciate you're having a look at it. Thanks!
Thierry
Peter
On Tue, Oct 13, 2015 at 9:36 AM, Thierry Goubier <thierry.goubier@gmail.com> wrote:
2015-10-13 9:29 GMT+02:00 Peter Uhnák <i.uhnak@gmail.com>:
On Tue, Oct 13, 2015 at 8:11 AM, Thierry Goubier < thierry.goubier@gmail.com> wrote:
Hi Hernà n,
I'm not familiar with the use of ssh-agent. Could it interfere with someone using his own keys (i.e. without ssh-agent)? Would this be necessary for linux or mac use of ssh-agent, or is ssh / git correctly done on those platforms to query ssh-agent on its own if it is already running?
I'm using ssh-agent on both windows and linux, and having aforementioned variables (SSH_AGENT_PID, SSH_AUTH_SOCK) in the environment is enough for git to automatically use it, no need to prefix it.
This is what I expected. Is that different under Windows?
this is the same under windows.
But the thing is: if I can query for environment variables in Windows, then so can the git command as well, which would mean it would pick-up the use of ssh-agent, no? Or should I try to manipulate the process
Anyway, I appreciate you're having a look at it. Thanks!
I was setting up ssh-agent under windows couple years ago so I don't quite remember what was the problem exactly, but iirc the problem was that ssh-agent was setting the variables only locally (maybe because it didn't understand windows env system). So the way I forced it to work was that I manually created a permanent record for SSH_AUTH_SOCK with some predefined path, and then I was starting the agent with "ssh-agent -a "$Env:SSH_AUTH_SOCK" this way the agent was bound the the socket specified by the global variable. Git itself was then able to correctly read the value from the environment, so I didn't have to change anything for git, it worked out of the box (as long as the env was correct). Interestingly I never needed SSH_AGENT_PID, but maybe git just needs the socket. Peter
2015-10-13 4:29 GMT-03:00 Peter Uhnák <i.uhnak@gmail.com>:
On Tue, Oct 13, 2015 at 8:11 AM, Thierry Goubier < thierry.goubier@gmail.com> wrote:
Hi Hernà n,
I'm not familiar with the use of ssh-agent. Could it interfere with someone using his own keys (i.e. without ssh-agent)? Would this be necessary for linux or mac use of ssh-agent, or is ssh / git correctly done on those platforms to query ssh-agent on its own if it is already running?
I'm using ssh-agent on both windows and linux, and having aforementioned variables (SSH_AGENT_PID, SSH_AUTH_SOCK) in the environment is enough for git to automatically use it, no need to prefix it.
I don't know if I get what you mean with prefix it. But the "set SSH_AGENT_PID=...." is done because the cmd.exe launched by ProcessWrapper does not detect SSH variables from other environment/term. I think many platforms (MinGW/MSYS/Cygwin) use something like this to launch ssh-agent for every term: echo "#!/bin/bash \ eval `ssh-agent -s` \ ssh-add" >> ~/.bashrc
In any case I have notes about the implementation:
1. it assumes that it runs only on windows (it looks like this should be generic code) 2. it assumes that ssh-agent will be always installed in a specific path, it should rely on PATH instead
Yes, some time ago I sent some FileSystem extensions to locate path binaries. I don't know if they are still around but it could be used.
3: Windows has its own system for global env variables, so why not use that? So instead of doing some process lookups you simply get $Env:SSH_AUTH_SOCK" (well, I use powershell... but the bat version is I think %SSH_AUTH_SOCK%)
I guess they could be used, but Git Bash is a MSYS command, so the environment variables need to be exported. Hernán
Peter
participants (5)
-
Alexandre Bergel -
Hernán Morales Durand -
Peter Uhnák -
Robert Withers -
Thierry Goubier