{"thread":{"id":"49509","subject":"[PATCH v2 0/2] EditorConfig file","startedAt":"2018-10-08T20:29:14Z","lastAt":"2018-10-08T21:55:09Z","messageCount":5,"participants":["brian m. carlson","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"359850","messageId":"20181008202903.100166-1-sandals@crustytoothpaste.net","threadId":"49509","inReplyTo":null,"subject":"[PATCH v2 0/2] EditorConfig file","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-10-08T20:29:01Z","receivedAt":"2018-10-08T20:29:14Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This series introduces an EditorConfig file to help developers using any\neditor set their editor's settings in conformance with the Git Project's\nsettings.  This is helpful for developers who work on different projects\nwith different indentation standards to keep their work in sync.\n\nChanges since v1:\n* Add notes to both .editorconfig and .clang-format that they should be\n  kept in sync.\n* Add commit message line length.\n\nbrian m. carlson (2):\n  editorconfig: provide editor settings for Git developers\n  editorconfig: indicate settings should be kept in sync\n\n .clang-format |  2 ++\n .editorconfig | 16 ++++++++++++++++\n 2 files changed, 18 insertions(+)\n create mode 100644 .editorconfig\n\n"},{"id":"359851","messageId":"20181008202903.100166-3-sandals@crustytoothpaste.net","threadId":"49509","inReplyTo":"20181008202903.100166-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 2/2] editorconfig: indicate settings should be kept in sync","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-10-08T20:29:03Z","receivedAt":"2018-10-08T20:29:16Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Now that we have two places where we set code formatting settings,\n.editorconfig and .clang-format, it's possible that they could fall out\nof sync.  This is relatively unlikely, since we're not likely to change\nthe tab width or our preference for tabs, but just in case, add comments\nto both files reminding future developers to keep them in sync.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n .clang-format | 2 ++\n .editorconfig | 2 ++\n 2 files changed, 4 insertions(+)\n\ndiff --git a/.clang-format b/.clang-format\nindex 12a89f95f9..de1c8b5c77 100644\n--- a/.clang-format\n+++ b/.clang-format\n@@ -6,6 +6,8 @@\n \n # Use tabs whenever we need to fill whitespace that spans at least from one tab\n # stop to the next one.\n+#\n+# These settings are mirrored in .editorconfig.  Keep them in sync.\n UseTab: Always\n TabWidth: 8\n IndentWidth: 8\ndiff --git a/.editorconfig b/.editorconfig\nindex 83227fa0b2..98d7c5ff99 100644\n--- a/.editorconfig\n+++ b/.editorconfig\n@@ -2,6 +2,8 @@\n charset = utf-8\n insert_final_newline = true\n \n+# The settings for C (*.c and *.h) files are mirrored in .clang-format.  Keep\n+# them in sync.\n [*.{c,h,sh,perl}]\n indent_style = tab\n tab_width = 8\n"},{"id":"359852","messageId":"20181008202903.100166-2-sandals@crustytoothpaste.net","threadId":"49509","inReplyTo":"20181008202903.100166-1-sandals@crustytoothpaste.net","subject":"[PATCH v2 1/2] editorconfig: provide editor settings for Git developers","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-10-08T20:29:02Z","receivedAt":"2018-10-08T20:29:17Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Contributors to Git use a variety of editors, each with their own\nconfiguration files.  Because C lacks the defined norms on how to indent\nand style code that other languages, such as Ruby and Rust, have, it's\npossible for various contributors, especially new ones, to have\nconfigured their editor to use a style other than the style the Git\ncommunity prefers.\n\nTo make automatically configuring one's editor easier, provide an\nEditorConfig file.  This is an INI-style configuration file that can be\nused to specify editor settings and can be understood by a wide variety\nof editors.  Some editors include this support natively; others require\na plugin.  Regardless, providing such a file allows users to\nautomatically configure their editor of choice with the correct settings\nby default.\n\nProvide global settings to set the character set to UTF-8 and insert a\nfinal newline into files.  Provide language-specific settings for C,\nShell, Perl, and Python files according to what CodingGuidelines already\nspecifies.  Since the indentation of other files varies, especially\ncertain AsciiDoc files, don't provide any settings for them until a\nclear consensus forward emerges.\n\nSet the line length for commit messages to 72 characters, which is the\ngenerally accepted line length for emails, since we send patches by\nemail.\n\nDon't specify an end of line type.  While the Git community uses\nUnix-style line endings in the repository, some Windows users may use\nGit's auto-conversion support and forcing Unix-style line endings might\ncause problems for those users.\n\nFinally, leave out a root directive, which would prevent reading other\nEditorConfig files higher up in the tree, in case someone wants to set\nthe end of line type for their system in such a file.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n .editorconfig | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)\n create mode 100644 .editorconfig\n\ndiff --git a/.editorconfig b/.editorconfig\nnew file mode 100644\nindex 0000000000..83227fa0b2\n--- /dev/null\n+++ b/.editorconfig\n@@ -0,0 +1,14 @@\n+[*]\n+charset = utf-8\n+insert_final_newline = true\n+\n+[*.{c,h,sh,perl}]\n+indent_style = tab\n+tab_width = 8\n+\n+[*.py]\n+indent_style = space\n+indent_size = 4\n+\n+[COMMIT_EDITMSG]\n+max_line_length = 72\n"},{"id":"359853","messageId":"87sh1gcg7z.fsf@evledraar.gmail.com","threadId":"49509","inReplyTo":"20181008202903.100166-2-sandals@crustytoothpaste.net","subject":"Re: [PATCH v2 1/2] editorconfig: provide editor settings for Git developers","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-10-08T20:53:52Z","receivedAt":"2018-10-08T20:53:57Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Oct 08 2018, brian m. carlson wrote:\n\n> Contributors to Git use a variety of editors, each with their own\n> configuration files.  Because C lacks the defined norms on how to indent\n> and style code that other languages, such as Ruby and Rust, have, it's\n> possible for various contributors, especially new ones, to have\n> configured their editor to use a style other than the style the Git\n> community prefers.\n>\n> To make automatically configuring one's editor easier, provide an\n> EditorConfig file.  This is an INI-style configuration file that can be\n> used to specify editor settings and can be understood by a wide variety\n> of editors.  Some editors include this support natively; others require\n> a plugin.  Regardless, providing such a file allows users to\n> automatically configure their editor of choice with the correct settings\n> by default.\n>\n> Provide global settings to set the character set to UTF-8 and insert a\n> final newline into files.  Provide language-specific settings for C,\n> Shell, Perl, and Python files according to what CodingGuidelines already\n> specifies.  Since the indentation of other files varies, especially\n> certain AsciiDoc files, don't provide any settings for them until a\n> clear consensus forward emerges.\n>\n> Set the line length for commit messages to 72 characters, which is the\n> generally accepted line length for emails, since we send patches by\n> email.\n>\n> Don't specify an end of line type.  While the Git community uses\n> Unix-style line endings in the repository, some Windows users may use\n> Git's auto-conversion support and forcing Unix-style line endings might\n> cause problems for those users.\n>\n> Finally, leave out a root directive, which would prevent reading other\n> EditorConfig files higher up in the tree, in case someone wants to set\n> the end of line type for their system in such a file.\n>\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n>  .editorconfig | 14 ++++++++++++++\n>  1 file changed, 14 insertions(+)\n>  create mode 100644 .editorconfig\n>\n> diff --git a/.editorconfig b/.editorconfig\n> new file mode 100644\n> index 0000000000..83227fa0b2\n> --- /dev/null\n> +++ b/.editorconfig\n> @@ -0,0 +1,14 @@\n> +[*]\n> +charset = utf-8\n> +insert_final_newline = true\n> +\n> +[*.{c,h,sh,perl}]\n> +indent_style = tab\n> +tab_width = 8\n\nIt looks like we can add at least \"pm\" and \"pl\" to that pattern:\n\n    $ git ls-files|grep -E -v -e '\\.(c|h|sh|perl)$' | grep -F .| sed 's/.*\\.//'|sort|uniq -c|sort -nr|head -n 15\n        631 txt\n         56 expect\n         48 po\n         41 test\n         40 tcl\n         34 gitignore\n         24 pm\n         18 patch\n         18 diff\n         16 pl\n         15 side\n         14 gitattributes\n         12 dump\n         11 sample\n          9 master\n\n> +[*.py]\n> +indent_style = space\n> +indent_size = 4\n> +\n> +[COMMIT_EDITMSG]\n> +max_line_length = 72\n"},{"id":"359855","messageId":"20181008215454.GQ432229@genre.crustytoothpaste.net","threadId":"49509","inReplyTo":"87sh1gcg7z.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 1/2] editorconfig: provide editor settings for Git developers","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-10-08T21:54:55Z","receivedAt":"2018-10-08T21:55:09Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Mon, Oct 08, 2018 at 10:53:52PM +0200, Ævar Arnfjörð Bjarmason wrote:\n> \n> It looks like we can add at least \"pm\" and \"pl\" to that pattern:\n\nSure.  I didn't think we had any of those, but you've just proven me\nwrong.  I'll send a v3 shortly.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}