From: Brandon Williams Date: Tue, 15 Aug 2017 17:34:45 GMT Subject: Re: [PATCH v2 1/2] clang-format: outline the git project's coding style Message-ID: <20170815173445.GA21874@google.com> In-Reply-To: <9c9a9b98-9308-95d6-a912-85a49bd3e21d@gmail.com> On 08/15, Ben Peart wrote: > > > On 8/14/2017 5:30 PM, Brandon Williams wrote: > >Add a '.clang-format' file which outlines the git project's coding > >style. This can be used with clang-format to auto-format .c and .h > >files to conform with git's style. > > > >Signed-off-by: Brandon Williams > >--- > > .clang-format | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 165 insertions(+) > > create mode 100644 .clang-format > > > > I applied this and then ran: > clang-format -i -style file *.c *.h builtin/*.c > > The modified files generate lots of line ending warnings. > Apparently clang-format isn't respecting the git settings for line > endings as it converted CRLF to LF in all the files it edited. > > $ git add . > warning: LF will be replaced by CRLF in alloc.c. > The file will have its original line endings in your working directory. > warning: LF will be replaced by CRLF in base85.c. > The file will have its original line endings in your working directory. > warning: LF will be replaced by CRLF in bisect.h. > [...] > I would think that there must be some setting to permit CRLF on windows machines. As I work on a unix machine I don't see this sort of behavior. -- Brandon Williams