git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Stephan Beyer <s-beyer@gmx.net>
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Brandon Williams <bmwill@google.com>
Subject: Re: [PATCH] clang-format: adjust line break penalties
Date: Fri, 29 Sep 2017 15:45:05 -0700	[thread overview]
Message-ID: <20170929224505.GN19555@aiede.mtv.corp.google.com> (raw)
In-Reply-To: <c1230d5b-ff84-8cf4-8ae7-b8387bf4bb04@gmx.net>

Stephan Beyer wrote:
> On 09/29/2017 08:40 PM, Jonathan Nieder wrote:

>> Going forward, is there an easy way to preview the effect of this kind
>> of change (e.g., to run "make style" on the entire codebase so as to be
>> able to compare the result with two different versions of
>> .clang-format)?
>
> I just ran clang-format before and after the patch and pushed to github.
> The resulting diff is quite big:
>
> https://github.com/sbeyer/git/commit/3d1186c4cf4dd7e40b97453af5fc1170f6868ccd

Thanks.  The first change I see there is

 -char *strbuf_realpath(struct strbuf *resolved, const char *path, int die_on_error)
 +char *
 +strbuf_realpath(struct strbuf *resolved, const char *path, int die_on_error)

I understand why the line is broken, but the choice of line break is
wrong.  Seems like the penalty for putting return type on its own line
quite high enough.

My Reviewed-by still stands, though.  It gets "make style" to signal
long lines that should be broken, which is an improvement.

> PS: There should be a comment at the beginning of the .clang-format file
> that says what version it is tested with (on my machine it worked with
> 5.0 but not with 4.0) and there should also probably a remark that the
> clang-format-based style should only be understood as a hint or guidance
> and that most of the Git codebase does not conform it.

Sounds good to me.  Care to send it as a patch? :)

Thanks,
Jonathan

  reply	other threads:[~2017-09-29 22:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29 18:26 [PATCH] clang-format: adjust line break penalties Johannes Schindelin
2017-09-29 18:40 ` Jonathan Nieder
2017-09-29 19:50   ` Brandon Williams
2017-09-29 22:39   ` Stephan Beyer
2017-09-29 22:45     ` Jonathan Nieder [this message]
2017-09-30 21:37       ` [PATCH] Add a comment to .clang-format about the meaning of the file Stephan Beyer
2017-10-01  2:45         ` Junio C Hamano
2017-10-01 15:44       ` [PATCH v2] " Stephan Beyer
2017-10-01 20:30         ` Junio C Hamano
2017-10-01 21:29           ` Stephan Beyer
2017-10-01 23:37         ` [PATCH v3] clang-format: add a comment about the meaning/status of the Junio C Hamano
2017-10-02 17:16           ` Stephan Beyer
2017-10-02 17:21           ` Brandon Williams
2017-10-03  1:08             ` Ramsay Jones
2017-10-01  2:40   ` [PATCH] clang-format: adjust line break penalties 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170929224505.GN19555@aiede.mtv.corp.google.com \
    --to=jrnieder@gmail.com \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=s-beyer@gmx.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).