* Git remote return custom error messages
@ 2020-09-27 22:26 Hampton Moore
2020-09-27 23:28 ` brian m. carlson
0 siblings, 1 reply; 2+ messages in thread
From: Hampton Moore @ 2020-09-27 22:26 UTC (permalink / raw)
To: git
Hello,
I have a custom ssh server that is handling validating users
permissions, is there a way for me to return custom text back to the
git client that's running push and pull? When I just send an error
like "NOT A DOMAIN" through STOUT the git client displays "fatal:
protocol error: bad line length character: NOT". I looked and could
not find any obvious documentation on how I could do this, or if it
would even be possible. Does anyone have any ideas?
Thank you,
Hampton Moore
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Git remote return custom error messages
2020-09-27 22:26 Git remote return custom error messages Hampton Moore
@ 2020-09-27 23:28 ` brian m. carlson
0 siblings, 0 replies; 2+ messages in thread
From: brian m. carlson @ 2020-09-27 23:28 UTC (permalink / raw)
To: Hampton Moore; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 1174 bytes --]
On 2020-09-27 at 22:26:56, Hampton Moore wrote:
> Hello,
> I have a custom ssh server that is handling validating users
> permissions, is there a way for me to return custom text back to the
> git client that's running push and pull? When I just send an error
> like "NOT A DOMAIN" through STOUT the git client displays "fatal:
> protocol error: bad line length character: NOT". I looked and could
> not find any obvious documentation on how I could do this, or if it
> would even be possible. Does anyone have any ideas?
You haven't specified at what stage you're thinking about sending this
result, so it's not 100% clear what the right answer is, but depending
on the stage, you could try two things.
First, you can try sending an error packet:
error-line = PKT-LINE("ERR" SP explanation-text)
That would usually be displayed to the user and it will be fatal. If
you're in the middle of the protocol, and this is non-fatal, you can try
using standard error, since that's usually hooked up to the terminal via
the sideband. It's possible some very old Git versions won't support
that, though.
--
brian m. carlson: Houston, Texas, US
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-27 23:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-27 22:26 Git remote return custom error messages Hampton Moore
2020-09-27 23:28 ` brian m. carlson
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).