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
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Dumping preprocessed work...
by
440bx
[
Today
at 01:59:14 am]
[ANN] PasBuild 1.2.0 Rele...
by
Graeme
[
Today
at 12:20:34 am]
Star Trek playing cards a...
by
TBMan
[February 08, 2026, 10:02:47 pm]
it2play - IT/S3M module r...
by
Lulu
[February 08, 2026, 09:50:23 pm]
Fast Canvas Library V1.05...
by
backprop
[February 08, 2026, 09:24:18 pm]
Lazaris IDE v4.4 - extrem...
by
CM630
[February 08, 2026, 08:10:36 pm]
How to determine the unkn...
by
CM630
[February 08, 2026, 08:06:39 pm]
Pre-Specialize Generic Fu...
by
MMarie
[February 08, 2026, 08:04:53 pm]
Change colors for Code Ex...
by
TBMan
[February 08, 2026, 07:37:40 pm]
Can we wallgarden this, p...
by
Mobius1
[February 08, 2026, 07:21:06 pm]
Testers needed - Skip met...
by
Martin_fr
[February 08, 2026, 05:10:28 pm]
FPC and Lazarus coding st...
by
Curt Carpenter
[February 08, 2026, 04:10:03 pm]
ThorVG - test (lightweigh...
by
LeP
[February 08, 2026, 04:00:06 pm]
Status of FPC 3.4.0 or FP...
by
Martin_fr
[February 08, 2026, 11:44:46 am]
Here's how to show colour...
by
Pallzi
[February 08, 2026, 11:19:27 am]
Transparent Form: Done di...
by
LV
[February 08, 2026, 08:38:31 am]
Lazarus for Windows on aa...
by
msintle
[February 08, 2026, 02:29:50 am]
Debian removes FPC/Lazaru...
by
dbannon
[February 08, 2026, 12:57:16 am]
Rolling releases Lazarus[...
by
dbannon
[February 08, 2026, 12:44:27 am]
GridPrinter requirements ...
by
sfeinst
[February 08, 2026, 12:39:07 am]
Lazarus programs look ugl...
by
the_magik_mushroom
[February 07, 2026, 11:54:12 pm]
LCL Web Native with D2Bri...
by
xinyiman
[February 07, 2026, 10:43:41 pm]
Recommendations for wasm3...
by
PascalDragon
[February 07, 2026, 10:38:15 pm]
Migrating SK1 Project to ...
by
jamie
[February 07, 2026, 09:13:45 pm]
[SOLVED] The main screen ...
by
Hansvb
[February 07, 2026, 06:50:52 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Why can TProcess run 'git status' but not 'git remote show origin'? (Read 5546 times)
vfclists
Hero Member
Posts: 1157
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: 4740
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: 1157
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: 12634
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: 12634
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: 12634
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