From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: "Josh Steadmon" <steadmon@google.com>, git <git@vger.kernel.org>,
"Jonathan Nieder" <jrnieder@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>,
"René Scharfe" <l.s.r@web.de>,
"brian m. carlson" <sandals@crustytoothpaste.net>,
"Brandon Williams" <bmwill@google.com>,
"Ben Peart" <Ben.Peart@microsoft.com>,
"Jeff Hostetler" <git@jeffhostetler.com>
Subject: Re: [PATCH 2/3] archive: implement protocol v2 archive command
Date: Thu, 13 Sep 2018 20:45:58 +0200 [thread overview]
Message-ID: <87k1npkzh5.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <CAGZ79kZOTsUH=zQX3rLXvuSOx1vp8C98maSn47ssfca8c-BrBQ@mail.gmail.com>
On Wed, Sep 12 2018, Stefan Beller wrote:
> On Tue, Sep 11, 2018 at 10:36 PM Josh Steadmon <steadmon@google.com> wrote:
>> + */
>> + status = packet_reader_read(&reader);
>> + }
>> + if (status != PACKET_READ_DELIM)
>> + die(_("upload-archive: expected delim packet"));
>
> This is upload-archive, which is a low level plumbing command
> (see the main man page of git for an explanation of that category),
> so we do not translate the error/die() calls. Besides, this is executed
> on the server, which might have a different locale than the requesting
> client?
>
> Would asking for a setlocale() on the server side be an unreasonable
> feature request for the capabilities (in a follow up patch, and then not
> just for archive but also fetch/push, etc.)?
This would be very nice to have, but as you suggest in some follow-up
change.
I think though that instead of doing setlocale() it would be better to
pass some flag saying we're operating in a machine-readable mode, and
then we'd (as part of the protocol defintion) say we're going to emit
GIT_ERR_UPLOAD_ARCHIVE_EXPECTED_DELIM_PACKET or whatever.
Advantages of doing that over a server-side setlocale():
1) Purely for translation purposes, users can update to a newer client
to get new translations, even though they're talking to an old
server.
2) Again, only for translation purposes, servers may not have the
appropriate locales generated and/or linked to libgettext.
3) Ditto, some clients that aren't git.git may want/need to emit
different translation messages to their consumers than what we have,
think some GUI client / Emacs magit etc. whose UI is different from
ours.
4) Aside from translation purposes, getting a machine-readable
"push/pull" etc. mode would be very handy. E.g. now you need to
parse stderr to see why exactly your push failed (hook denied, or
non-fast-forward, or non-fast-forward where there was a lock race
condition? ...).
I also wonder if something like #4 wouldn't compliment something like
the proposed structured logging[1]. I.e. even though we'd like to run
git.git, and present exactly the message to the user we do now, we might
want to run in such a machine-readable mode under the hood when talking
to the server so we can log exactly how the push went / how it failed
for the purposes of aggregation.
1. https://public-inbox.org/git/20180713165621.52017-2-git@jeffhostetler.com/
next prev parent reply other threads:[~2018-09-13 18:46 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 5:35 Add proto v2 archive command with HTTP support Josh Steadmon
2018-09-12 5:35 ` [PATCH 1/3] archive: use packet_reader for communications Josh Steadmon
2018-09-12 22:01 ` Stefan Beller
2018-09-13 14:58 ` Junio C Hamano
2018-09-13 15:34 ` Junio C Hamano
2018-09-12 5:35 ` [PATCH 2/3] archive: implement protocol v2 archive command Josh Steadmon
2018-09-12 22:28 ` Stefan Beller
2018-09-13 18:45 ` Ævar Arnfjörð Bjarmason [this message]
2018-09-14 6:05 ` Jonathan Nieder
2018-09-14 14:31 ` Ævar Arnfjörð Bjarmason
2018-09-14 16:14 ` Junio C Hamano
2018-09-14 16:19 ` Jonathan Nieder
2018-09-13 16:31 ` Junio C Hamano
2018-09-14 5:39 ` Jonathan Nieder
2018-09-12 5:35 ` [PATCH 3/3] archive: allow archive over HTTP(S) with proto v2 Josh Steadmon
2018-09-12 22:38 ` Stefan Beller
2018-09-13 16:47 ` Junio C Hamano
2018-09-27 20:28 ` Josh Steadmon
2018-09-14 5:57 ` Jonathan Nieder
2018-09-14 5:36 ` Add proto v2 archive command with HTTP support Jonathan Nieder
2018-09-27 1:24 ` [PATCH v2 0/4] " Josh Steadmon
2018-09-27 1:24 ` [PATCH v2 1/4] archive: follow test standards around assertions Josh Steadmon
2018-09-27 18:38 ` Stefan Beller
2018-09-27 1:24 ` [PATCH v2 2/4] archive: use packet_reader for communications Josh Steadmon
2018-09-27 18:42 ` Stefan Beller
2018-09-27 1:24 ` [PATCH v2 3/4] archive: implement protocol v2 archive command Josh Steadmon
2018-09-27 1:24 ` [PATCH v2 4/4] archive: allow archive over HTTP(S) with proto v2 Josh Steadmon
2018-09-27 18:20 ` [PATCH v2 0/4] Add proto v2 archive command with HTTP support Stefan Beller
2018-09-27 18:30 ` Jonathan Nieder
2018-09-27 22:20 ` Junio C Hamano
2018-09-27 22:33 ` Josh Steadmon
2018-09-28 1:25 ` Junio C Hamano
2018-09-27 18:30 ` Josh Steadmon
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=87k1npkzh5.fsf@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=Ben.Peart@microsoft.com \
--cc=bmwill@google.com \
--cc=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=l.s.r@web.de \
--cc=sandals@crustytoothpaste.net \
--cc=sbeller@google.com \
--cc=steadmon@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.