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
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
New version of LazMapView...
by
wp
[
Today
at 12:37:49 pm]
Forum slow for others as ...
by
PascalDragon
[
Today
at 11:58:48 am]
accessing array members i...
by
cdbc
[
Today
at 10:16:05 am]
WebP images and BGRABitma...
by
paweld
[
Today
at 09:43:16 am]
Avaiable instruction set
by
LemonParty
[
Today
at 09:26:31 am]
RGB Plasma
by
Gigatron
[
Today
at 08:47:37 am]
Amigo programming languag...
by
paxscript
[
Today
at 07:56:57 am]
2d "platform" game sugges...
by
Roland57
[
Today
at 07:52:39 am]
Knob Finger Spinner Graph...
by
SandyG
[
Today
at 06:45:22 am]
This is me back in Lazaru...
by
Weiss
[
Today
at 06:34:41 am]
How to DIY a filerec reco...
by
TYDQ
[
Today
at 05:59:45 am]
GTK3 still alpha
by
regs
[
Today
at 01:46:35 am]
looping direction control...
by
440bx
[April 19, 2025, 08:08:37 pm]
ppaslink.sh: line 9: 6262...
by
Thaddy
[April 19, 2025, 07:58:29 pm]
JSON parser handler
by
cdbc
[April 19, 2025, 07:01:19 pm]
[SOLVED] Converting psd f...
by
TRon
[April 19, 2025, 06:58:36 pm]
Best way to exchange data...
by
Hansvb
[April 19, 2025, 06:24:07 pm]
[Solved] How to call a cl...
by
nikel
[April 19, 2025, 05:09:22 pm]
Announcing TRURL RPN Engi...
by
jwdietrich
[April 19, 2025, 05:07:49 pm]
TRURL's segmitator availa...
by
jwdietrich
[April 19, 2025, 05:05:36 pm]
TRURL G released
by
jwdietrich
[April 19, 2025, 05:03:40 pm]
Animated Sine Flower
by
Thaddy
[April 19, 2025, 04:33:52 pm]
Compile Error on Assign f...
by
Thaddy
[April 19, 2025, 04:27:02 pm]
making types totally inco...
by
Thaddy
[April 19, 2025, 03:13:24 pm]
Why VirtualDBTreeEx not c...
by
wp
[April 19, 2025, 01:08:42 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Why can TProcess run 'git status' but not 'git remote show origin'? (Read 5281 times)
vfclists
Hero Member
Posts: 1147
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: 4695
Web, Desktop & Android developer
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: 1147
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: 12142
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: 537
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: 12142
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: 12142
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: 537
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