From: Christian Couder <chriscool@tuxfamily.org>
To: johan@herland.net
Cc: gitster@pobox.com, git@vger.kernel.org, josh@joshtriplett.org,
tr@thomasrast.ch, mhagger@alum.mit.edu, dan.carpenter@oracle.com,
greg@kroah.com
Subject: Re: [RFC/PATCH] Add interpret-trailers builtin
Date: Tue, 05 Nov 2013 06:42:19 +0100 (CET) [thread overview]
Message-ID: <20131105.064219.1992046444757435360.chriscool@tuxfamily.org> (raw)
In-Reply-To: <CALKQrgcweo+B8JKH85-4-SOHsAi6SAxstnXhRWCst_qEyXYmhA@mail.gmail.com>
From: Johan Herland <johan@herland.net>
> On Mon, Nov 4, 2013 at 8:12 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Johan Herland <johan@herland.net> writes:
>>>> +{
>>>> + char *end = strchr(arg, '=');
>>>> + if (!end)
>>>> + end = strchr(arg, ':');
>>>
>>> So both '=' (preferred) and ':' are accepted as field/value
>>> separators. That's ok for the command-line, I believe.
>>
>> Why?
>>
>> Sometimes you have to be loose from the beginning _if_ some existing
>> uses and established conventions make it easier for the users,
The users are already used to appending "Acked-by: Joe <joe@example.com>".
So I think it makes it easier for the user to accept what they are already
used to provide.
>> but
>> if you do not have to start from being loose, it is almost always a
>> mistake to do so. The above code just closed the door to use ":"
>> for some other useful purposes we may later discover, and will make
>> us regret for doing so.
>
> Although I agree with the principle, I think there are (at least) two
> established conventions that will be commonly used from the start, and
> that we should support:
>
> - Using short forms with '=', e.g. "ack=Peff". There is already a
> convention on how we specify <name> + <value> pairs on the command
> line, e.g. "git -c foo=bar ..."
>
> - Copy-pasting footers from existing commit messages. These will have
> the same format as the expected output of this command, and not
> accepting the same format in its input seems silly, IMHO.
I agree. Also I think it will avoid some mistakes by the users.
Because it would require an effort for them to remember that if they
want to see "Acked-by: Joe <joe@example.com>" they have to put
"Acked-by= Joe <joe@example.com>" on the command line.
> That said, I think this applies only to the formatting on the _command
> line_.
But wouldn't it be nice if the same parsing function could be used for
both the command line and the commit message template?
> When it comes to how the resulting footers are formatted in the
> commit message, I would argue it only makes sense to use ':', and I
> think the testcase named 'with config setup and = sign' in the above
> patch is ugly and unnecessary.
I wanted to support configurations like this:
[trailer "ack"]
value = "Acked-by= "
[trailer "bug"]
value = "Bug #"
because Peff said that GitHub uses '#' and while at it I suppose some
people might prefer '=' over ':'.
Thanks,
Christian.
next prev parent reply other threads:[~2013-11-05 5:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-03 21:17 [RFC/PATCH] Add interpret-trailers builtin Christian Couder
2013-11-04 1:01 ` Johan Herland
2013-11-04 19:12 ` Junio C Hamano
2013-11-05 2:45 ` Johan Herland
2013-11-05 5:42 ` Christian Couder [this message]
2013-11-05 19:09 ` Junio C Hamano
2013-11-04 19:02 ` Junio C Hamano
2013-11-06 6:43 ` Christian Couder
2013-11-06 9:23 ` Christian Couder
2013-11-06 17:18 ` Junio C Hamano
2013-11-06 20:16 ` Christian Couder
2013-11-06 20:42 ` Junio C Hamano
2013-11-07 14:57 ` Christian Couder
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=20131105.064219.1992046444757435360.chriscool@tuxfamily.org \
--to=chriscool@tuxfamily.org \
--cc=dan.carpenter@oracle.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=greg@kroah.com \
--cc=johan@herland.net \
--cc=josh@joshtriplett.org \
--cc=mhagger@alum.mit.edu \
--cc=tr@thomasrast.ch \
/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).