All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Maxwell Bernstein <tekk.nolagi@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Max Bernstein via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,
	Max Bernstein <donotemailthisaddress@bernsteinbear.com>,
	Max Bernstein <max@bernsteinbear.com>,
	Jonathan Tan <jonathantanmy@google.com>
Subject: Re: [PATCH v2] trailer: allow spaces in tokens
Date: Thu, 18 Aug 2022 22:46:18 +0200	[thread overview]
Message-ID: <CAP8UFD1304rQh+9jMUkTmTvmNBxm6BNDt3=d07+C8iXSbJb2RA@mail.gmail.com> (raw)
In-Reply-To: <CM9DZ4Z18PY9.1T2O8U54X66FD@cedar>

On Thu, Aug 18, 2022 at 9:03 PM Maxwell Bernstein <tekk.nolagi@gmail.com> wrote:
>
> On Thu Aug 18, 2022 at 9:54 AM PDT, Junio C Hamano wrote:
> > So, the updated code mistook the body of the message that is not a
> > sign-off, because there is a colon on the line, the line does not
> > begin with the colon, and everything before the colon is an alnum or
> > a whitespace, so squashed the paragraph break before the real
> > trailer block and the last line of the body and made it a body-less
> > commit log message?
>
> I agree that it is not ideal, and I'm not sure how to fix it. This commit
> probably shouldn't go in as-is; I modified the test in order to demonstrate
> this problem.
>
> > This might be a good demonstration of why it is a mistaken design to
> > allow whitespaces, which may steer us toward fixing the documentation?
> >
> > I dunno.  What do others think?
>
> I think allowing whitespace is good at least for the Phabricator project, which
> despite being dead, has a number of existing users and existing commits. It
> unfortunately has a "Differential revision" trailer with whitespace.

I think allowing one white space before the separator is a good idea
for the following reasons.

First, if people use something like #, !, ~ or % as a separator, for
example in the case of a trailer like "Bug #43", it is very natural to
have a white space before the # separator.

Note that GitLab for example uses the ~N format, where N is a number,
for issues, !N for merge requests and %N for milestones. I think
Bugzilla and many other bug trackers use a #N format for bug numbers.

Also in some languages, like French, the typographical rules when
writing regular text is to have a space (technically it's supposed to
be a "non breaking space", see:
https://en.wikipedia.org/wiki/Non-breaking_space, but in practice
people use a regular space most of the time) before a colon. So it is
very natural for a number of people in the world to automatically add
a white space before a colon.

https://en.wikipedia.org/wiki/Colon_(punctuation)#Spacing says: "In
print, a thin space was traditionally placed before a colon and a
thick space after it. In modern English-language printing, no space is
placed before a colon and a single space is placed after it. In
French-language typing and printing, the traditional rules are
preserved. "

I think it would be very annoying for users to find out that a number
of otherwise proper trailers would not be taken into account only
because they have a white space before the colon. At least there
should be an option to allow that.

  reply	other threads:[~2022-08-18 20:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18  7:06 [PATCH] trailer: allow spaces in tokens Max Bernstein via GitGitGadget
2022-08-18  7:54 ` [PATCH v2] " Max Bernstein via GitGitGadget
2022-08-18 16:54   ` Junio C Hamano
2022-08-18 17:56     ` Jonathan Tan
2022-08-18 19:03     ` Maxwell Bernstein
2022-08-18 20:46       ` Christian Couder [this message]
2022-08-18 21:31         ` Junio C Hamano
2022-08-19  4:33           ` Junio C Hamano
2022-08-19 10:29             ` Christian Couder
2022-08-22 13:58               ` Johannes Schindelin
2022-08-23 14:06               ` [PATCH] Documentation: clarify whitespace rules for trailers Christian Couder
2022-08-24 18:13                 ` Junio C Hamano
2022-08-25 11:59                   ` Christian Couder
2022-08-25 16:20                     ` Junio C Hamano
2022-08-30 10:50                     ` [PATCH v2] " Christian Couder
2022-08-30 17:20                       ` Junio C Hamano
2022-08-18 16:48 ` [PATCH] trailer: allow spaces in tokens Junio C Hamano
2022-08-18 17:52   ` Jonathan Tan
2022-08-18 17:58     ` Junio C Hamano

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='CAP8UFD1304rQh+9jMUkTmTvmNBxm6BNDt3=d07+C8iXSbJb2RA@mail.gmail.com' \
    --to=christian.couder@gmail.com \
    --cc=donotemailthisaddress@bernsteinbear.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=jonathantanmy@google.com \
    --cc=max@bernsteinbear.com \
    --cc=tekk.nolagi@gmail.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.