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
Practical Ways to Help La...
by
TRon
[
Today
at 10:03:41 pm]
Why isn't Lazarus / Free ...
by
PascalDragon
[
Today
at 09:48:50 pm]
A problem with ptcmouse
by
TBMan
[
Today
at 09:40:51 pm]
BGRAGtkBitmap
by
Fred vS
[
Today
at 09:35:47 pm]
Lazarus Release 4.0
by
Hansvb
[
Today
at 09:20:05 pm]
Why there is no build-in ...
by
Nimbus
[
Today
at 08:50:15 pm]
Feature request/suggestio...
by
440bx
[
Today
at 08:05:11 pm]
Feature request/suggestio...
by
440bx
[
Today
at 07:58:33 pm]
Build mode Help button do...
by
440bx
[
Today
at 07:54:27 pm]
TSynCompletion failing wh...
by
Martin_fr
[
Today
at 06:55:20 pm]
How to convert TStrings t...
by
Remy Lebeau
[
Today
at 06:35:35 pm]
Animated Oscillating Line...
by
Nitorami
[
Today
at 05:57:07 pm]
3D Dot Ball
by
Dzandaa
[
Today
at 05:43:47 pm]
FPC 3.2.2 + NASM Windows ...
by
paule32
[
Today
at 05:08:38 pm]
[SOLVED] Added components...
by
Rico54
[
Today
at 03:27:20 pm]
I can write your README.m...
by
PeterBB
[
Today
at 03:15:57 pm]
[SOLVED] How to "Jump To"...
by
paweld
[
Today
at 02:40:52 pm]
PZ_Nes emulator
by
Ñuño_Martínez
[
Today
at 02:29:40 pm]
Problems with Word
by
loaded
[
Today
at 02:17:56 pm]
Handle double click on a ...
by
rich2014
[
Today
at 01:49:23 pm]
Selecting Memo lines drif...
by
munair
[
Today
at 12:57:29 pm]
Question for people who h...
by
Lenny33
[
Today
at 12:57:17 pm]
project - count source li...
by
munair
[
Today
at 10:09:39 am]
[SOLVED] Anyone can tell ...
by
CharlyTango
[
Today
at 08:50:19 am]
Anyone into mDNS?
by
MaxM74
[
Today
at 08:29:16 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Why can TProcess run 'git status' but not 'git remote show origin'? (Read 5288 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: 4705
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: 12194
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: 12194
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: 12194
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