git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Hampton Moore <hamptonm@usc.edu>
Cc: git@vger.kernel.org
Subject: Re: Git remote return custom error messages
Date: Sun, 27 Sep 2020 23:28:59 +0000	[thread overview]
Message-ID: <20200927232859.GF1392312@camp.crustytoothpaste.net> (raw)
In-Reply-To: <CAOefx6Ro6ixiccDq_xH-UsjNWTcjKy=YQfCs7b0ZQkLjSb-0zQ@mail.gmail.com>

[-- 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 --]

      reply	other threads:[~2020-09-27 23:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-27 22:26 Git remote return custom error messages Hampton Moore
2020-09-27 23:28 ` brian m. carlson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200927232859.GF1392312@camp.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=hamptonm@usc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).