summaryrefslogtreecommitdiff
path: root/Documentation/CodingGuidelines
AgeCommit message (Collapse)Author
2011-02-15CodingGuidelines: downcase placeholders in usage messagesJunio C Hamano
We accumulated some inconsistencies without an explicit guidance to spell this out over time. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-04Fix typos in the documentationRalf Wildenhues
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-04Merge branch 'sn/diff-doc'Junio C Hamano
* sn/diff-doc: docs: clarify git diff modes of operation diff,difftool: Don't use the {0,2} notation in usage strings CodingGuidelines: Add a section on writing documentation
2010-12-03CodingGuidelines: mention whitespace preferences for shell scriptsGiuseppe Bilotta
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-05CodingGuidelines: Add a section on writing documentationŠtěpán Němec
Provide a few examples on argument and option notation in usage strings and command synopses. Signed-off-by: Štěpán Němec <stepnem@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-13CodingGuidelines: reword parameter expansion sectionJunio C Hamano
Group entries related to parameter substitutions together and avoid using the word "regexp" to refer to the ${parameter/pattern/string} substitution (banned), as the pattern there is a shell glob and not a regular expression. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-27CodingGuidelines: spell Arithmetic Expansion with $(($var))Junio C Hamano
POSIX wants shells to support both "N" and "$N" and requires them to yield the same answer to $((N)) and $(($N)), but we should aim for portability in a case like this, especially when the price we pay to do so is so small, i.e. a few extra dollars. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-10lstat_cache(): swap func(length, string) into func(string, length)Kjetil Barvik
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 <barvik@broadpark.no> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-26Mention "local convention" rule in the CodingGuidelinesNanako Shiraishi
The document suggests to imitate the existing code, but didn't say which existing code it should imitate. This clarifies. Signed-off-by: しらいしななこ <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-22Rename path_list to string_listJohannes Schindelin
The name path_list was correct for the first usage of that data structure, but it really is a general-purpose string list. $ perl -i -pe 's/path-list/string-list/g' $(git grep -l path-list) $ perl -i -pe 's/path_list/string_list/g' $(git grep -l path_list) $ git mv path-list.h string-list.h $ git mv path-list.c string-list.c $ perl -i -pe 's/has_path/has_string/g' $(git grep -l has_path) $ perl -i -pe 's/path/string/g' string-list.[ch] $ git mv Documentation/technical/api-path-list.txt \ Documentation/technical/api-string-list.txt $ perl -i -pe 's/strdup_paths/strdup_strings/g' $(git grep -l strdup_paths) ... and then fix all users of string-list to access the member "string" instead of "path". Documentation/technical/api-string-list.txt needed some rewrapping, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-25CodingGuidelines: Add a note to avoid assignments inside if()Miklos Vajna
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-02CodingGuidelines: spell out how we use grep in our scriptsJunio C Hamano
Our scripts try to stick to fairly limited subset of POSIX BRE for portability. It is unclear from manual page from GNU grep which is GNU extension and which is portable, so let's spell it out to help new people to keep their contributions from hurting porters. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-08Add Documentation/CodingGuidelinesJohannes Schindelin
Even if our code is quite a good documentation for our coding style, some people seem to prefer a document describing it. The part about the shell scripts is clearly just copied from one of Junio's helpful mails, and some parts were added from comments by Junio, Andreas Ericsson and Robin Rosenberg. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>