Setting Git/SmartGit SSH Client's home folder
Asked Answered
T

1

6

I'm wondering if anyone can shed some insight into why SmartGit isn't behaving when I'm connecting to our source control server through SSH. GitBash behaves fine.

Background:

I've got a source control server set up on the network, running MSYSGit with WinSSH as the SSH server. It hooks into AD to resolve usernames etc, and I've imported all the public RSA keys etc. Everything works peachy.

One curve-ball for us, is that although Git is installed at 'C:\Program Files (x86)\Git' our actual source code sits at 'C:\Git', which is backed up regularly.

I've configured WinSSH to make all SSH sessions default to 'C:\Git' as their home folder, which works a treat. When I use Git Bash to connect to the server, it defaults to 'C:\Git'. Perfect.

When I get SmartGit (using SmartGit SSH Client) to connect to the same server, with url:

    ssh://<server>/<folder>/<repo>

I get an error saying the path...

    C:\Program Files (x86)\Git\<folder>\<repo> 

...doesn't appear to be a repository. Well, yeah... It should be looking for it in 'C:\Git', not 'C:\Program Files (x86)\Git'.

I'm not sure why SmartGit doesn't place nice with this setup, but I reckon the default WinSSH settings are being bypassed by its SSH client, since its specifying the whole path completely from 'C:\Program Files (x86)\Git'.

My Questions:

Any ideas where SmartGit might be getting the 'C:\Program Files (x86)\Git' path from?

Is this a variable I can set somewhere?

Further Information (Update)

The version of SmartGit is 3.0.4, however the issue was also present in 2.x.

I have attached what (I'm pretty sure) is an instance of the failure in the SmartGit application log:

1782732 (2012-05-10 12:18:56,653) [QThreadPoolThread-2 (smartgit.KL)] INFO smartgit.core.executable - Executing following command: "C:\Program Files\Git\bin\git.exe" ls-remote ssh://initio-dev01/INIT/INIT.Framework.git refs/heads/

1782732 (2012-05-10 12:18:56,653) [QThreadPoolThread-2 (smartgit.KL)] INFO smartgit.core.executable - in directory: null

1783049 (2012-05-10 12:18:56,970) [QThreadPoolThread-8 (smartgit.aqT)] INFO smartgit.server - received command: ssh

1786438 (2012-05-10 12:19:00,359) [QThreadPoolThread-6 (smartgit.cR)] INFO smartgit.command.logging - stderr: fatal: 'C:/Program Files (x86)/Git/INIT/INIT.Framework.git' does not appear to be a git repository

1786438 (2012-05-10 12:19:00,359) [QThreadPoolThread-6 (smartgit.cR)] INFO smartgit.core.command - fatal: 'C:/Program Files (x86)/Git/INIT/INIT.Framework.git' does not appear to be a git repository

1786439 (2012-05-10 12:19:00,360) [Thread-29] ERROR smartgit.ssh.trilead - com.trilead.ssh2.transport.TransportManager: Receive thread: error in receiveLoop: socket closed

1786763 (2012-05-10 12:19:00,684) [QThreadPoolThread-6 (smartgit.cR)] INFO smartgit.command.logging - stderr: fatal: The remote end hung up unexpectedly

1786763 (2012-05-10 12:19:00,684) [QThreadPoolThread-6 (smartgit.cR)] INFO smartgit.core.command - fatal: The remote end hung up unexpectedly

1786772 (2012-05-10 12:19:00,693) [QThreadPoolThread-2 (smartgit.KL)] WARN sg.command.ping - 'C:/Program Files (x86)/Git/INIT/INIT.Framework.git' does not appear to be a git repository The remote end hung up unexpectedly smartgit.cn: 'C:/Program Files (x86)/Git/INIT/INIT.Framework.git' does not appear to be a git repository The remote end hung up unexpectedly

at smartgit.gG.a(SourceFile:86)

at smartgit.ga.a(SourceFile:63)

at smartgit.ga.a(SourceFile:53)

at smartgit.hA.a(SourceFile:57)

at smartgit.ahq.a(SourceFile:26)

at smartgit.ahl.a(SourceFile:39)

at smartgit.aL.a(SourceFile:46)

at smartgit.aD.a(SourceFile:41)

at smartgit.Kw.a(SourceFile:144)

at smartgit.KL.run(SourceFile:34)

at smartgit.Pp.run(SourceFile:65)

Terra answered 10/5, 2012 at 3:27 Comment(4)
What exact version of SmartGit are you using? What's the corresponding error message/stacktrace from SmartGit's log.txt (in SmartGit's settings directory, see About dialog)?Banderole
Thanks, I didn't know about that log file. I've updated the question with an example of the error. Unfortunately, I don't think it sheds any more light... You can see that it enters the remote address with the SSH url, but attempts to pull from C:\Program Files (x86)\ but that's about it.Terra
Does git-ssh.log in SmartGit's settings directory contain any useful information? Also, add "log4j.category.smartgit.ssh.client=DEBUG" line to logj4.properties and restart SmartGit. This will give more debug output for the SSH connection in log.txt. Please post the "smartgit.ssh.client"-related lines again.Banderole
Quick update: Although I don't have an answer for the original question, I thought I'd post about what I did to get the solution working in the end. Using the portable version of Git, I installed it into the same folder at C:\Git. SmartGit seems to default to the installation location, so when I did this, it ended up defaulting to the correct base folder at C:\Git. Flip side is that Git's binaries are now also in the same folder as the source code. Some might say this is prudent, since its now a part of the schedule backups also.Terra
M
1

Very annoying with hardcoded path's, which might seem to be the problem here?! Until this is fixed in a later version, maybe you should create a directory junction point or symbolic link instead. Could be a (quick and dirty) solution instead of spending time on fixing the program.

(must be run in a Administrator shell)

For junction point:

mklink /j "C:\Program Files (x86)\GIT\<folder>" C:\GIT\<folder>

For symbolic link:

mklink /d "C:\Program Files (x86)\GIT\<folder>" C:\GIT\<folder>
Mateya answered 16/5, 2012 at 12:30 Comment(1)
Great, outside-the-box idea and I did consider it. The breaker for me though was that as I understand it, a junction point will redirect everything and not only the git session.Terra

© 2022 - 2024 — McMap. All rights reserved.