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
TpageControl at design ti...
by
wp
[
Today
at 01:22:47 am]
Series Transparency under...
by
wp
[
Today
at 01:19:02 am]
Lazarus IDE Start Up Issu...
by
Aruna
[
Today
at 01:10:01 am]
Reading text out loud?
by
jamie
[March 23, 2025, 11:12:55 pm]
CPC 464 Game Images
by
Gigatron
[March 23, 2025, 08:24:23 pm]
(Solved) Illegal paramete...
by
TRon
[March 23, 2025, 07:09:21 pm]
Test Regular Expressions
by
Gustavo 'Gus' Carreno
[March 23, 2025, 06:37:24 pm]
Mint Cinnamon: Cannot sho...
by
CM630
[March 23, 2025, 06:15:00 pm]
Trunk 3.3.1 access violat...
by
noname01
[March 23, 2025, 06:00:02 pm]
Crash in app
by
biologic
[March 23, 2025, 05:59:52 pm]
Peano Fractals: Rainbow t...
by
HolgerT
[March 23, 2025, 05:57:29 pm]
NIL vs. Assign: when to u...
by
AlexTP
[March 23, 2025, 04:08:37 pm]
Forum sloooow again...
by
Thaddy
[March 23, 2025, 04:03:23 pm]
I am interested in learni...
by
krolikbest
[March 23, 2025, 03:45:54 pm]
Very Slow Online Package ...
by
incendio
[March 23, 2025, 03:38:42 pm]
Using Bresenham's line al...
by
TBMan
[March 23, 2025, 03:37:47 pm]
Weird error: component no...
by
jamie
[March 23, 2025, 02:38:58 pm]
Online Package Manager
by
wp
[March 23, 2025, 12:51:36 pm]
Explaining Generics and S...
by
Thaddy
[March 23, 2025, 11:52:36 am]
Rotating a simple bitmap ...
by
marcov
[March 23, 2025, 11:50:07 am]
Lazarus on Mint - Palette...
by
dbannon
[March 23, 2025, 08:32:53 am]
AVRPascal – free code edi...
by
ackarwow
[March 23, 2025, 07:55:51 am]
fpsSpreadsheet. Unable t...
by
dgrhoads
[March 23, 2025, 03:11:52 am]
IDE tabs and spaces, auto...
by
n7800
[March 23, 2025, 02:42:52 am]
[SOLVED] What is the name...
by
n7800
[March 23, 2025, 01:52:19 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Why can TProcess run 'git status' but not 'git remote show origin'? (Read 5267 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: 4691
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: 12118
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: 12118
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: 12118
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