From dfb047b9e4f7f66c5322ef642f21fd92b0a975e3 Mon Sep 17 00:00:00 2001 From: Nanako Shiraishi Date: Mon, 26 Jan 2009 17:32:22 +0900 Subject: Mention "local convention" rule in the CodingGuidelines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The document suggests to imitate the existing code, but didn't say which existing code it should imitate. This clarifies. Signed-off-by: しらいしななこ Signed-off-by: Junio C Hamano --- Documentation/CodingGuidelines | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Documentation/CodingGuidelines') diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index f628c1f3b7..0d7fa9cca9 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -21,8 +21,13 @@ code. For git in general, three rough rules are: As for more concrete guidelines, just imitate the existing code (this is a good guideline, no matter which project you are -contributing to). But if you must have a list of rules, -here they are. +contributing to). It is always preferable to match the _local_ +convention. New code added to git suite is expected to match +the overall style of existing code. Modifications to existing +code is expected to match the style the surrounding code already +uses (even if it doesn't match the overall style of existing code). + +But if you must have a list of rules, here they are. For shell scripts specifically (not exhaustive): -- cgit v1.2.3 From 571998921d8fd4ee674545406aabb86987921252 Mon Sep 17 00:00:00 2001 From: Kjetil Barvik Date: Mon, 9 Feb 2009 21:54:06 +0100 Subject: lstat_cache(): swap func(length, string) into func(string, length) Swap function argument pair (length, string) into (string, length) to conform with the commonly used order inside the GIT source code. Also, add a note about this fact into the coding guidelines. Signed-off-by: Kjetil Barvik Signed-off-by: Junio C Hamano --- Documentation/CodingGuidelines | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation/CodingGuidelines') diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index 0d7fa9cca9..b8bf618a30 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -129,3 +129,6 @@ For C programs: used in the git core command set (unless your command is clearly separate from it, such as an importer to convert random-scm-X repositories to git). + + - When we pass pair to functions, we should try to + pass them in that order. -- cgit v1.2.3