comparison README @ 12421:e8d2c6fc33ad

Use spaces for indentation, not tabs.
author Bruno Haible <bruno@clisp.org>
date Thu, 10 Dec 2009 20:28:30 +0100
parents 51e19b43ff65
children c2cbabec01dd
comparison
equal deleted inserted replaced
12420:5850b9a81029 12421:e8d2c6fc33ad
47 Download: http://www.kernel.org/pub/software/scm/git/ 47 Download: http://www.kernel.org/pub/software/scm/git/
48 Tutorial: http://git.or.cz/course/ 48 Tutorial: http://git.or.cz/course/
49 http://www.kernel.org/pub/software/scm/git/docs/tutorial.html 49 http://www.kernel.org/pub/software/scm/git/docs/tutorial.html
50 FAQ: http://git.or.cz/gitwiki/GitFaq 50 FAQ: http://git.or.cz/gitwiki/GitFaq
51 51
52 When you use "git annotate" or "git blame" with gnulib, it's recommended that
53 you use the "-w" option, in order to ignore massive whitespace changes that
54 happened in 2009.
55
52 CVS checkouts are also supported: 56 CVS checkouts are also supported:
53 $ cvs -d :pserver:anonymous@pserver.git.sv.gnu.org:/gnulib.git co -d gnulib HEAD 57 $ cvs -d :pserver:anonymous@pserver.git.sv.gnu.org:/gnulib.git co -d gnulib HEAD
54 58
55 Gnulib is hosted on savannah.gnu.org. The project page is 59 Gnulib is hosted on savannah.gnu.org. The project page is
56 http://savannah.gnu.org/projects/gnulib. 60 http://savannah.gnu.org/projects/gnulib.
106 Keep in mind that if you submit patches to files in Gnulib, you should 110 Keep in mind that if you submit patches to files in Gnulib, you should
107 license them under a compatible license, which means that sometimes 111 license them under a compatible license, which means that sometimes
108 the contribution will have to be LGPL, if the original file is 112 the contribution will have to be LGPL, if the original file is
109 available under LGPL via a "License: LGPL" information in the 113 available under LGPL via a "License: LGPL" information in the
110 projects' modules/ file. 114 projects' modules/ file.
115
116
117 Indent with spaces, not TABs
118 ----------------------------
119 We use space-only indentation in nearly all files. This includes all
120 *.h, *.c, *.y files, except for the regex module. Makefile and ChangeLog
121 files are excluded, since TAB characters are part of their format.
122
123 In order to tell your editor to produce space-only indentation, you
124 can use these instructions.
125
126 * For Emacs: Add these lines to your Emacs initialization file
127 ($HOME/.emacs or similar):
128
129 ;; In gnulib, indent with spaces everywhere (not TABs).
130 ;; Exceptions: Makefile and ChangeLog modes.
131 (add-hook 'find-file-hook '(lambda ()
132 (if (and buffer-file-name
133 (string-match "/gnulib\\>" (buffer-file-name))
134 (not (string-equal mode-name "Change Log"))
135 (not (string-equal mode-name "Makefile")))
136 (setq indent-tabs-mode nil))))
137
138 * For vi (vim): Add these lines to your $HOME/.vimrc file:
139
140 " Don't use tabs for indentation. Spaces are nicer to work with.
141 set expandtab
142
143 For Makefile and ChangeLog files, compensate this by adding this to
144 your $HOME/.vim/after/indent/make.vim and
145 $HOME/.vim/after/indent/changelog.vim files:
146
147 " Use tabs for indentation, regardless of the global setting.
148 set noexpandtab
149
150 * For Eclipse: In the "Window|Preferences" dialog (or "Eclipse|Preferences"
151 dialog on MacOS),
152 1. Under "General|Editors|Text Editors", select the "Insert spaces for tabs"
153 checkbox.
154 2. Under "C/C++|Code Style", select a code style profile that has the
155 "Indentation|Tab policy" combobox set to "Spaces only", such as the
156 "GNU [built-in]" policy.
157
158 If you use the GNU indent program, pass it the option '--no-tabs'.
111 159
112 160
113 How to add a new module 161 How to add a new module
114 ----------------------- 162 -----------------------
115 * Add the header files and source files to lib/. 163 * Add the header files and source files to lib/.