From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: christian.couder@gmail.com, jrnieder@gmail.com,
git@vger.kernel.org, josh@joshtriplett.org,
sunshine@sunshineco.com, ramsay@ramsay1.demon.co.uk
Subject: Re: [PATCH v9 11/11] Documentation: add documentation for 'git interpret-trailers'
Date: Mon, 07 Apr 2014 15:00:11 -0700 [thread overview]
Message-ID: <xmqqr458ls0k.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140407.205800.839733420387302333.chriscool@tuxfamily.org> (Christian Couder's message of "Mon, 07 Apr 2014 20:58:00 +0200 (CEST)")
Christian Couder <chriscool@tuxfamily.org> writes:
> From: Junio C Hamano <gitster@pobox.com>
>>
>> A different way to sell a colon, e.g.
>>
>> Consider the instruction sed takes on its command line.
>> (e.g. "sed 's/frotz/nitfol/' <xyzzy"). In the most general
>> form, you would always give it as the value of an '-e' option
>> (e.g. "sed -e 's/frotz/nitfol' <xyzzy"), but you are allowed to
>> be loose in limited occassions. "Key:value" is like that, and
>> in the most general form, it actually needs to be spelled as
>> "-e 'Key:value'".
>>
>> is possible, but I do not think it is a particularly good analogy,
>> because what you have as the alternative is "Key=value", and not
>> "-e 'Key:value'", or "--Key=value" (the last would probably be the
>> most natural way to express this).
>
> The analogy that I would use is rather that Perl lets people use
> 's:foo:bar:' as well as 's=foo=bar=' instead of 's/foo/bar/' if they
> prefer.
I could *almost* buy that, but that does not hold as you are not
allowing (and I do not think you need to in this case) the user to
pick any termination character like "s|foo|bar|". The only thing
you are doing is forbidding both ":" and "=" from the set of allowed
characters for labels.
However.
I think we could buy the syntax if the "Key:value" form were the
*only* form, *without* accepting "Key=value".
The latter is a poor attempt to pretend as if it is a normal command
line option, but because that form does not even take double-dashes
at the beginning, it even fails to mimic as a command line option.
It would be one way to reduce the unnecessary cognitive load from
the users when learning the Git command line argument convention to
reject the "key=value" form and only stick to "key: value" form.
After all, because of the shape of the footer we add to the log
message (i.e. a keyword label followed by a colon followed by a SP
followed by the value), it is clear that we can use ":" as the
separator without inconveniencing the users who want to use some
unusual characters in the label part, but there is no strong reason
to reject an equal sign in the label.
prev parent reply other threads:[~2014-04-07 22:00 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 19:20 [PATCH v9 00/11] Add interpret-trailers builtin Christian Couder
2014-04-01 19:20 ` [PATCH v9 01/11] trailer: add data structures and basic functions Christian Couder
2014-04-01 19:20 ` [PATCH v9 02/11] trailer: process trailers from stdin and arguments Christian Couder
2014-04-01 19:20 ` [PATCH v9 03/11] trailer: read and process config information Christian Couder
2014-04-01 19:20 ` [PATCH v9 04/11] trailer: process command line trailer arguments Christian Couder
2014-04-01 19:20 ` [PATCH v9 05/11] trailer: parse trailers from stdin Christian Couder
2014-04-01 19:20 ` [PATCH v9 06/11] trailer: put all the processing together and print Christian Couder
2014-04-01 19:20 ` [PATCH v9 07/11] trailer: add interpret-trailers command Christian Couder
2014-04-01 19:20 ` [PATCH v9 08/11] trailer: add tests for "git interpret-trailers" Christian Couder
2014-04-01 22:51 ` Junio C Hamano
2014-04-01 22:54 ` Junio C Hamano
2014-04-02 6:02 ` Christian Couder
2014-04-01 19:20 ` [PATCH v9 09/11] trailer: execute command from 'trailer.<name>.command' Christian Couder
2014-04-01 19:20 ` [PATCH v9 10/11] trailer: add tests for commands in config file Christian Couder
2014-04-01 19:20 ` [PATCH v9 11/11] Documentation: add documentation for 'git interpret-trailers' Christian Couder
2014-04-02 0:39 ` Jonathan Nieder
2014-04-02 6:01 ` Christian Couder
2014-04-04 22:33 ` Junio C Hamano
2014-04-04 22:42 ` Junio C Hamano
2014-04-07 9:39 ` Christian Couder
2014-04-07 16:52 ` Junio C Hamano
2014-04-07 18:58 ` Christian Couder
2014-04-07 19:34 ` Junio C Hamano
2014-04-07 22:00 ` Junio C Hamano [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=xmqqr458ls0k.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=josh@joshtriplett.org \
--cc=jrnieder@gmail.com \
--cc=ramsay@ramsay1.demon.co.uk \
--cc=sunshine@sunshineco.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.