git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Dragan Simic <dsimic@manjaro.org>
Cc: Ralph Seichter via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,  rsbecker@nexbridge.com,
	 Ralph Seichter <github@seichter.de>
Subject: Re: [PATCH v2] config: add --comment option to add a comment
Date: Mon, 11 Mar 2024 12:54:36 -0700	[thread overview]
Message-ID: <xmqqzfv4pmrn.fsf@gitster.g> (raw)
In-Reply-To: <dd818f1709834ca6cb9050fb4ad0f4ea@manjaro.org> (Dragan Simic's message of "Mon, 11 Mar 2024 18:34:41 +0100")

Dragan Simic <dsimic@manjaro.org> writes:

>>> Let me interject...  Perhaps also a tab character before the "#
>>> comment",
>>> instead of a space character.  That would result in even better
>>> readability.
>> Depends on your screen width ;-)
>
> Ah, screens are pretty wide these days. :)
>
>> If you were trying to tell me that SP or no SP is merely a personal
>> preference with the comment, I think you succeeded in doing so.
>
> Huh, that wasn't my intention.  IMHO, a space character between "#"
> and the actual comment is pretty much mandatory.

Ah, OK, you were talking about the gap after the value before the
"#" that introduces the comment, but I somehow mistook it as a
comment about the whitespace after '#'.

The gap after the value, I do not have a strong opinion either way
between SP and HT, except that I agree there should be something
there for readability.

Given that other places where we do insert comments, like in the log
message editor during "git commit -e", we always give a single space
after the comment character, I tend to agree that a space after '#'
is pretty much mandatory.  It is a non starter to tell users that
they should add their own SP at the beginning if they want to use
such a common style, i.e.

	git commit --comment=' here is my message' ;# BAD

With a simple rule like "Unless your message begins with '#', the
message is prepended by '# ' (pound, followed by a SP), but when
your message begins with '#', the string is used as is", those who
want to use their own style can use whatever style they want, e.g.

	git commit --comment='#I do not want SP there'
	git commit --comment='#^II want a HT there instead'

and that would be a much more preferrable design, i.e. making the
common things easy, while leaving unusual things possible.

Thanks.


  reply	other threads:[~2024-03-11 19:54 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04  6:00 [PATCH] Allow git-config to append a comment Ralph Seichter via GitGitGadget
2024-03-06 16:01 ` Junio C Hamano
2024-03-06 17:24   ` Ralph Seichter
2024-03-07 12:12     ` Junio C Hamano
2024-03-07 12:44       ` Ralph Seichter
2024-03-07 13:27         ` Junio C Hamano
2024-03-07 13:53       ` rsbecker
2024-03-07 15:26         ` Ralph Seichter
2024-03-07 15:40           ` rsbecker
2024-03-07 15:57             ` Ralph Seichter
2024-03-07 15:15 ` [PATCH v2] config: add --comment option to add " Ralph Seichter via GitGitGadget
2024-03-11 12:55   ` Junio C Hamano
2024-03-11 16:17     ` Dragan Simic
2024-03-11 16:48       ` rsbecker
2024-03-11 17:00         ` Dragan Simic
2024-03-11 17:52           ` Dragan Simic
2024-03-11 17:29       ` Junio C Hamano
2024-03-11 17:34         ` Dragan Simic
2024-03-11 19:54           ` Junio C Hamano [this message]
2024-03-12  2:25             ` Dragan Simic
2024-03-11 18:23       ` Ralph Seichter
2024-03-11 18:50         ` Dragan Simic
2024-03-11 18:57           ` Ralph Seichter
2024-03-11 19:04             ` Dragan Simic
2024-03-11 21:31               ` Junio C Hamano
2024-03-12  2:38                 ` Dragan Simic
2024-03-11 19:17             ` rsbecker
2024-03-12  2:27               ` Dragan Simic
2024-03-11 18:16     ` Ralph Seichter
2024-03-11 18:55       ` Dragan Simic
2024-03-11 19:04         ` Ralph Seichter
2024-03-12  6:19       ` Ralph Seichter
2024-03-12  6:37         ` Chris Torek
2024-03-12  7:28           ` Ralph Seichter
2024-03-12  7:44             ` Junio C Hamano
2024-03-12 21:47   ` [PATCH v3] " Ralph Seichter via GitGitGadget
2024-03-15 22:15     ` Junio C Hamano
2024-03-15 22:26       ` [PATCH 3/1] config: allow tweaking whitespace between value and comment Junio C Hamano
2024-03-26 22:06         ` Junio C Hamano
2024-03-26 22:48           ` Ralph Seichter
2024-03-26 23:27             ` Junio C Hamano
2024-03-27  0:27               ` Ralph Seichter
2024-03-27  1:23                 ` Dragan Simic
2024-03-27 17:27                 ` Junio C Hamano
2024-03-15 23:10       ` [PATCH v3] config: add --comment option to add a comment Eric Sunshine
2024-03-15 23:41         ` Junio C Hamano
2024-03-15 23:44           ` 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=xmqqzfv4pmrn.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=dsimic@manjaro.org \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=github@seichter.de \
    --cc=rsbecker@nexbridge.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 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).