From: Martin Koegler <mkoegler@auto.tuwien.ac.at>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Martin Koegler <mkoegler@auto.tuwien.ac.at>
Subject: [PATCH] Document conding style
Date: Wed, 27 Feb 2008 09:13:30 +0100 [thread overview]
Message-ID: <12041000101604-git-send-email-mkoegler@auto.tuwien.ac.at> (raw)
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
---
Documentation/CodingGuidelines | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 3b042db..e1b5d78 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -77,6 +77,30 @@ For C programs:
of "else if" statements, it can make sense to add braces to
single line blocks.
+ - Avoid trailing whitespaces
+
+ - Pointer to struct foo type is (struct foo *), not (struct foo*)
+
+ - One space each around comparison operator "=="
+
+ - One space around assignment operator "="
+
+ - One space after "if", "while", "switch" and friends before "("
+
+ - No space between function name and "("
+
+ - A function without parameter is "static void foo(void)", not
+ "static void foo()"
+
+ - Don't do any declaration after a statement.
+
+ - Multi-line comment is:
+
+ /*
+ * This is multi line comment
+ * and this is its second line.
+ */
+
- Try to make your code understandable. You may put comments
in, but comments invariably tend to stale out when the code
they were describing changes. Often splitting a function
@@ -105,6 +129,9 @@ For C programs:
changed and discussed. Many git commands started out like
that, and a few are still scripts.
+ - Consider checking your patches with checkpatch from the linux
+ kernel. It helps you to spot trivial formating errors.
+
- Avoid introducing a new dependency into git. This means you
usually should stay away from scripting languages not already
used in the git core command set (unless your command is clearly
--
1.5.4.3.ga3d8
next reply other threads:[~2008-02-27 8:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-27 8:13 Martin Koegler [this message]
2008-02-27 8:36 ` [PATCH] Document conding style David Symonds
2008-02-27 9:43 ` Johannes Schindelin
2008-02-28 13:07 ` Jean-Luc Herren
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=12041000101604-git-send-email-mkoegler@auto.tuwien.ac.at \
--to=mkoegler@auto.tuwien.ac.at \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).