Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
Why can TProcess run 'git status' but not 'git remote show origin'?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Offical launch of the 1 B...
by
Gustavo 'Gus' Carreno
[
Today
at 12:50:46 am]
what to do if my target M...
by
Laksen
[
Today
at 12:49:12 am]
For-in loop over constant...
by
ASerge
[
Today
at 12:36:09 am]
Converting a string/index...
by
TRon
[April 18, 2024, 11:56:37 pm]
exclude ALL packages from...
by
PascalDragon
[April 18, 2024, 11:33:29 pm]
Demoscene The Champs Crac...
by
KodeZwerg
[April 18, 2024, 11:29:50 pm]
Poll: Watches and Display...
by
440bx
[April 18, 2024, 10:55:14 pm]
Database standards OR Am ...
by
dseligo
[April 18, 2024, 10:50:26 pm]
BUG REPORT: Unable to gen...
by
PascalDragon
[April 18, 2024, 10:24:23 pm]
How to: create DLL file f...
by
paule32
[April 18, 2024, 10:23:59 pm]
Have anyone develop UEFI ...
by
PascalDragon
[April 18, 2024, 10:14:15 pm]
Lazarus for Windows on aa...
by
PascalDragon
[April 18, 2024, 10:09:10 pm]
The weird Rewrite bug
by
PascalDragon
[April 18, 2024, 09:58:53 pm]
Assign (textfile) not com...
by
PascalDragon
[April 18, 2024, 09:51:50 pm]
Question for people who h...
by
PascalDragon
[April 18, 2024, 09:44:32 pm]
Linux Workspaces -- StayO...
by
AmatCoder
[April 18, 2024, 08:34:20 pm]
I just released a commerc...
by
Seenkao
[April 18, 2024, 07:57:21 pm]
Access violation when re-...
by
TRon
[April 18, 2024, 07:37:31 pm]
[SOLVED] assembler name i...
by
TRon
[April 18, 2024, 07:26:33 pm]
A fairly simple sound sol...
by
KodeZwerg
[April 18, 2024, 07:01:52 pm]
Step-into the field sette...
by
Martin_fr
[April 18, 2024, 06:54:19 pm]
[Fun Fact] PNG and Micros...
by
Ten_Mile_Hike
[April 18, 2024, 06:24:19 pm]
HTTP/2+HTTP/1.1+WebSocket...
by
iLya2IK
[April 18, 2024, 06:14:30 pm]
Improvement of TFPTimerTh...
by
AlexTP
[April 18, 2024, 05:56:38 pm]
Arabic text, problem on L...
by
nouzi
[April 18, 2024, 05:21:27 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Why can TProcess run 'git status' but not 'git remote show origin'? (Read 4994 times)
vfclists
Hero Member
Posts: 1013
Why can TProcess run 'git status' but not 'git remote show origin'?
«
on:
February 23, 2017, 01:38:42 pm »
I am using TProcess to run git commands by passing the directory to execute the command in as well as the command itself.
When the command is a local command like 'git status' or 'git branch' the output is okay. 'git remote show origin' results in an error.
Is the problem likely to be with the nature of the 'git remote show origin' itself or is it something within TProcess? 'git remote show origin' requires a remote connection via ssh but they key has been added to the ssh-agent so it should work fine.
'git remote show origin' executes an ssh command but as I have added the key via keychain it doesn't require a password.
Logged
Lazarus 3.0/FPC 3.2.2
lainz
Hero Member
Posts: 4468
Re: Why can TProcess run 'git status' but not 'git remote show origin'?
«
Reply #1 on:
February 23, 2017, 01:55:43 pm »
you can show us the code?
Logged
https://lainz.github.io/
vfclists
Hero Member
Posts: 1013
Re: Why can TProcess run 'git status' but not 'git remote show origin'?
«
Reply #2 on:
February 23, 2017, 02:13:09 pm »
After further tests it seems that the environment created by TProcess does not inherit the ssh-agent key settings. After adding a uploading the remote with a password less authorization key the commands work.
Is there a way to get TProcess to inherit the settings that a 'bash' or a 'screen' session would automatically acquire?
Logged
Lazarus 3.0/FPC 3.2.2
marcov
Administrator
Hero Member
Posts: 11452
FPC developer.
Re: Why can TProcess run 'git status' but not 'git remote show origin'?
«
Reply #3 on:
February 23, 2017, 02:45:26 pm »
Copy the relevant keys from environment into .environment ?
Logged
Trenatos
Hero Member
Posts: 535
Re: Why can TProcess run 'git status' but not 'git remote show origin'?
«
Reply #4 on:
October 18, 2017, 04:29:24 am »
I know this is an old post, but I'm having almost the exact same issue (git pull).
Marcov, what do you mean copy the keys from environment to .environment?
Logged
marcov
Administrator
Hero Member
Posts: 11452
FPC developer.
Re: Why can TProcess run 'git status' but not 'git remote show origin'?
«
Reply #5 on:
October 18, 2017, 11:48:00 am »
You can set the environment of TProcess by modifying its environment property.
I interpreted vfclists' " not inherit ssh-agent key settings" as something not propagating in the environment variables.
Logged
mse
Sr. Member
Posts: 286
Re: Why can TProcess run 'git status' but not 'git remote show origin'?
«
Reply #6 on:
October 18, 2017, 01:44:42 pm »
IIRC it also could be an issue with ssh and pseudo terminal echo settings. In MSEgit the git commands are executed by the MSEgui TProcess derivate. The code is here:
https://gitlab.com/mseide-msegui/mseuniverse/tree/master/tools/msegit
Binaries:
https://sourceforge.net/projects/mseuniverse/
Logged
marcov
Administrator
Hero Member
Posts: 11452
FPC developer.
Re: Why can TProcess run 'git status' but not 'git remote show origin'?
«
Reply #7 on:
October 18, 2017, 02:06:55 pm »
Seems that ssh agent forwarding uses the SSH_AUTH_SOCK environment variable.
So
aprocess.environment.add('SSH_AUTH_SOCK='+getenvironmentvariable('SSH_AUTH_SOCK'));
might help.
Logged
Trenatos
Hero Member
Posts: 535
Re: Why can TProcess run 'git status' but not 'git remote show origin'?
«
Reply #8 on:
October 18, 2017, 03:06:01 pm »
It turns out I was having a different issue, solved now, but this is very good info regardless, bookmarking.
Thanks guys!
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
Why can TProcess run 'git status' but not 'git remote show origin'?
TinyPortal
© 2005-2018