gnu-c++-standards
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ code indentation for GNU


From: James Youngman
Subject: Re: C++ code indentation for GNU
Date: Mon, 12 Aug 2019 09:56:23 +0100

On Sun, Aug 11, 2019 at 1:04 PM Bruno Haible <address@hidden> wrote:
>
> Ian Lance Taylor wrote:
> > As far as the actual formatting goes, I don't see any reason not to
> > follow the format used by the GCC source code
> > (https://gcc.gnu.org/codingconventions.html#Cxx_Formatting).  To me it
> > seems like a straightforward extension of the GNU C formatting
> > conventions.
>
> Two objections:
[...]
> 2) The rule "Do not indent protection labels." makes it harder to work with
> git diff.
>
> Git is the de-facto standard for source code management, and developers
> spend a lot of times working with git diff:
>   1. to review patches sent by mail,
>   2. to produce GNU-style ChangeLog entries.
> Therefore the coding style and the 'git diff' implementation ought to
> work well together.

It seems to me that if the class name is the right thing to provide as
context in "git diff" then it would be better were it able to do so
whatever the indentation of the protection labels.   Improving git
seems the most obvious strategy.   Do you know if anybody has looked
at this?

In 2025, having a style guide with a stipulation designed for better
interoperability with a by-then-obsolete version of git is going to
seem an odd decision.

James.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]