git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] Add a comment to .clang-format about the meaning of the file

From
Stephan Beyer <s-beyer@gmx.net>
Date
Oct 1, 2017, 15:44 UTC
Message-ID
<20171001154425.5568-1-s-beyer@gmx.net>
In-Reply-To
<20170929224505.GN19555@aiede.mtv.corp.google.com>

Having a .clang-format file in a project can be understood in a way that code has to be in the style defined by the .clang-format file, i.e., you just have to run clang-format over all code and you are set. This is not the case in the Git project, which is now reflected by a comment in the beginning of the file.

Additionally, the working clang-format version is mentioned because the config directives change from time to time (in a compatibility-breaking way).

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
Notes:
    On 10/01/2017 04:45 AM, Junio C Hamano wrote:
    > it makes as if a random patch to "make it
    > conform" without thinking if the rules make sense were a welcome
    > addition, which is absolutely the last signal we would want to send
    > to the readers.
    
    Right. I dropped that last sentence and replaced it by a sentence about human
    aesthetics judgement overruling mechanical rules -- I think that's somehow quoted
    from a comment of yours on the list.
 .clang-format | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/.clang-format b/.clang-format
index 3ede2628d..041b7be03 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,4 +1,8 @@
-# Defaults
+# This file is an example configuration for clang-format 5.0.
+#
+# Note that this style definition should only be understood as a hint
+# for writing new code. In the end, human aesthetics judgement overrules
+# mechanical rules.
 
 # Use tabs whenever we need to fill whitespace that spans at least from one tab
 # stop to the next one.
-- 
2.14.2.677.g5a59ab275
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 15 in “clang-format: adjust line break penalties”
  1. clang-format: adjust line break penaltiesJohannes Schindelin, Sep 29, 2017
  2. Jonathan NiederSep 29, 2017
  3. Brandon WilliamsSep 29, 2017
  4. Stephan BeyerSep 29, 2017
  5. Jonathan NiederSep 29, 2017
  6. Add a comment to .clang-format about the meaning of the fileStephan Beyer, Sep 30, 2017
  7. Junio C HamanoOct 1, 2017
  8. Add a comment to .clang-format about the meaning of the fileStephan Beyer, Oct 1, 2017
  9. Junio C HamanoOct 1, 2017
  10. Stephan BeyerOct 1, 2017
  11. clang-format: add a comment about the meaning/status of theJunio C Hamano, Oct 1, 2017
  12. Stephan BeyerOct 2, 2017
  13. Brandon WilliamsOct 2, 2017
  14. Ramsay JonesOct 3, 2017
  15. Junio C HamanoOct 1, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.