From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org, e@80x24.org, peff@peff.net,
dwwang@google.com, dennis@kaarsemaker.net
Subject: Re: [PATCH 3/4] push: accept push options
Date: Thu, 07 Jul 2016 13:52:22 -0700 [thread overview]
Message-ID: <xmqq60shp3w9.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160707011218.3690-4-sbeller@google.com> (Stefan Beller's message of "Wed, 6 Jul 2016 18:12:17 -0700")
Stefan Beller <sbeller@google.com> writes:
> +-L::
> +--push-option::
> + Transmit the given string to the server, which passes them to
> + the pre-receive as well as the post-receive hook. Only C strings
> + containing no new lines are allowed.
This is to affect what happens at the remote end, so I would have
understood "-R". I also would have understood "-P" as a short-hand
for "--push-option". What is the justification of "-L"?
What does "C strings" mean? Did you mean to say "A sequence of
bytes excluding NUL is passed verbatim"?
I do not think I saw anything in the code I reviewed so far that
requires "no LF" limitation.
... Ahh, OK, you want to make sure that push-options are
one-per-line in the push certificate. While I do not think it is
absolutely necessary, starting with a possibly tighter than
necessary limitation is much better than starting loose and having
to tighten it later.
> } else {
> struct transport *transport =
> transport_get(remote, NULL);
> -
> + if (flags & TRANSPORT_PUSH_OPTIONS)
> + transport->push_options = push_options;
The result would be easier to read without the removal of a blank
that separates decl/defn and stmt here.
> @@ -533,6 +542,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
> 0, "signed", &push_cert, "yes|no|if-asked", N_("GPG sign the push"),
> PARSE_OPT_OPTARG, option_parse_push_signed },
> OPT_BIT(0, "atomic", &flags, N_("request atomic transaction on remote side"), TRANSPORT_PUSH_ATOMIC),
> + OPT_STRING_LIST('o', "push-option", &push_options, N_("server-specific"), N_("option to transmit")),
Here it seems to expect "-o". If we really want a short option,
"-o" would probably be OK, as I do not think "git push" wants to
have "send the output to this file" option.
> diff --git a/send-pack.c b/send-pack.c
> index 299d303..c943560 100644
> --- a/send-pack.c
> +++ b/send-pack.c
> @@ -260,6 +260,7 @@ static int generate_push_cert(struct strbuf *req_buf,
> const char *push_cert_nonce)
> {
> const struct ref *ref;
> + struct string_list_item *item;
> char *signing_key = xstrdup(get_signing_key());
> const char *cp, *np;
> struct strbuf cert = STRBUF_INIT;
> @@ -278,6 +279,12 @@ static int generate_push_cert(struct strbuf *req_buf,
> strbuf_addf(&cert, "nonce %s\n", push_cert_nonce);
> strbuf_addstr(&cert, "\n");
>
> + if (args->push_options) {
> + for_each_string_list_item(item, args->push_options)
> + strbuf_addf(&cert, "push-option %s\n", item->string);
> + strbuf_addstr(&cert, "\n");
Why the extra blank?
I would actually have expected to see
certificate version ...
pusher ...
<datestamp>
pushee ... # optional
nonce ... # optional
push-option ... # optional
push-option ... # optional
<old> <new> <name>
...
by adding this between the two lines in the pre-context of this
hunk, i.e.
if (push_cert_nonce[0])
strbuf_addf(&cert, "nonce %s\n", push_cert_nonce);
if (args->push_options)
for_each_string_list_item(item, args->push_options)
strbuf_addf(&cert, "push-option %s\n", item->string);
strbuf_addstr(&cert, "\n");
next prev parent reply other threads:[~2016-07-07 20:52 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-07 1:12 [PATCHv3 0/4] Push options in C Git Stefan Beller
2016-07-07 1:12 ` [PATCH 1/4] push options: {pre,post}-receive hook learns about push options Stefan Beller
2016-07-07 20:20 ` Junio C Hamano
2016-07-07 21:50 ` Stefan Beller
2016-07-07 21:53 ` Junio C Hamano
2016-07-07 1:12 ` [PATCH 2/4] receive-pack: implement advertising and receiving " Stefan Beller
2016-07-07 20:37 ` Junio C Hamano
2016-07-07 21:41 ` Stefan Beller
2016-07-07 21:56 ` Jeff King
2016-07-07 22:06 ` Stefan Beller
2016-07-07 22:09 ` Jeff King
2016-07-07 22:06 ` Junio C Hamano
2016-07-08 17:58 ` Jonathan Nieder
2016-07-08 18:39 ` Junio C Hamano
2016-07-08 18:57 ` Stefan Beller
2016-07-08 21:46 ` Jeff King
2016-07-08 22:17 ` Stefan Beller
2016-07-08 22:21 ` Jeff King
2016-07-08 22:29 ` Stefan Beller
2016-07-08 22:35 ` Jeff King
2016-07-08 22:43 ` Stefan Beller
2016-07-08 22:46 ` Jeff King
2016-07-08 22:51 ` Stefan Beller
2016-07-07 1:12 ` [PATCH 3/4] push: accept " Stefan Beller
2016-07-07 20:52 ` Junio C Hamano [this message]
2016-07-08 22:59 ` Stefan Beller
2016-07-11 18:42 ` Junio C Hamano
2016-07-07 1:12 ` [PATCH 4/4] add a test for " Stefan Beller
2016-07-07 19:51 ` Junio C Hamano
2016-07-07 20:01 ` Junio C Hamano
2016-07-07 21:51 ` Stefan Beller
-- strict thread matches above, loose matches on Subject: below --
2016-07-14 21:49 [PATCHv7 0/4] Push options Stefan Beller
2016-07-14 21:49 ` [PATCH 3/4] push: accept push options Stefan Beller
2016-07-14 17:39 [PATCHv5 0/4] Push options Stefan Beller
2016-07-14 17:39 ` [PATCH 3/4] push: accept push options Stefan Beller
2016-07-09 0:31 [PATCHv4 0/4] Push options Stefan Beller
2016-07-09 0:31 ` [PATCH 3/4] push: accept push options Stefan Beller
2016-06-30 0:59 [RFC PATCHv1 0/4] Push options in C Git Stefan Beller
2016-06-30 0:59 ` [PATCH 3/4] push: accept push options Stefan Beller
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq60shp3w9.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=dennis@kaarsemaker.net \
--cc=dwwang@google.com \
--cc=e@80x24.org \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=sbeller@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.
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).