From: Junio C Hamano <gitster@pobox.com>
To: "Sidney San Martín" <s@sidneysm.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Support wrapping commit messages when you read them
Date: Sun, 25 Dec 2011 01:57:13 -0800 [thread overview]
Message-ID: <7vfwg99dom.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <8DE6E894-B50D-4F7E-AE18-C10E7E40A550@sidneysm.com> ("Sidney San Martín"'s message of "Sat, 24 Dec 2011 21:05:32 -0800")
Sidney San Martín <s@sidneysm.com> writes:
> Fairly simpleminded line wrapping that makes commit messages
> readable if they weren’t wrapped by the committer.
This does not say anything useful, other than "this is a naïve
implementation of message wrapper" and invites "So what?".
The most simple-minded solution is to reject such commits with crappy log
message.
After all, SCM is merely a method to help communication between
developers, and sticking to the common denominator is a proven good way to
make sure everybody involved in the project can use what is recorded in
the repository. This is not limited only to the log message, but equally
applies to filenames (e.g. don't create xt_tcpmss.c and xt_TCPMSS.c in the
same directory if you want your project extractable on case insensitive
filesystems) and even to the sources.
You need to justify the cause a bit better. Why is such a new logic
justified?
> - Use strbuf_add_wrapped_text() to do the dirty work
> - Detect simple lists which begin with "+ ", "* ", or "- " and indent
> them appropriately (like this line)
> - Print lines which begin with whitespace as-is (e.g. code samples)
I suspect the above would make it more palatable than format=flowed
brought up in earlier discussions, which is unsuitable for nothing but
straight text.
> Add --wrap[=<width>] and --no-wrap to commands that pretty-print commit
> messages, and add log.wrap and log.wrap.width configuration options.
Why do you need two separate options and configurations that look as if
they are independent but in reality not? If you say "no wrap", there is
no room for you to say "wrap width is 72".
I would expect something like:
--log-message-wrap, --log-message-wrap=72, --log-message-wrap=no
with --log-message-wrap=yes as a synonym for --log-message-wrap to give
consistency. The corresponding configuraiton would be log.messageWrap
whose values could be the usual bool-or-int.
> log.wrap defaults to never, and can be set to never/false, auto/true,
> or always. If auto, hijack want_color() to decide whether it’s
> appropriate to use line wrapping. (This is a little hacky, but as far
> as I can tell the conditions for auto color and auto wrapping are the
> same.
Why does coloring have _anything_ to do with line wrapping? Maybe your
personaly preference might be "wrap and color if interactive terminal" but
that is conflating two unrelated concepts. A user may not expect coloring
on a dumb interactive terminal, but wrapping may still be useful.
> log.wrap.width defaults to 80.
This does not deserve a comment as I already rejected the "two
configuration" approach, but do not use three-level names this way. We try
to reserve three-level names only for cases where the second level is used
for an unbound collection (e.g. "remote.$name.url", "branch.$name.merge").
that is user-specified.
next prev parent reply other threads:[~2011-12-25 9:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-25 5:05 [PATCH] Support wrapping commit messages when you read them Sidney San Martín
2011-12-25 9:57 ` Junio C Hamano [this message]
2012-02-13 21:26 ` Sidney San Martín
2012-02-13 22:25 ` Junio C Hamano
2012-02-14 12:10 ` Holger Hellmuth
2012-02-20 21:09 ` Sidney San Martín
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=7vfwg99dom.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=s@sidneysm.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