[ANet-devel] Development Setup for ANet
Status: Abandoned
Brought to you by:
benad
From: Benoit N. <be...@ma...> - 2001-05-20 00:31:29
|
(Soon, this email will be placed in the web site) (Note: from today, you can use "sf.net" instead of "sourceforge.net" in ALL the URLs!) Coding Standard First, make a document named ".emacs" in your home directory with this content: (global-font-lock-mode 1) (defun my-c-mode-common-hook () (c-set-offset 'substatement-open 0) (c-set-offset 'statement-cont 0) (c-toggle-auto-hungry-state 1) ) (add-hook 'c-mode-common-hook 'my-c-mode-common-hook) (custom-set-variables '(c-hanging-braces-alist (quote ((brace-list-open) (brace-entry-open) (substatement-open before after) (block-close . c-snug-do-while) (extern-lang-open after) (inexpr-class-open after) (inexpr-class-close before) (defun-open before after) (defun-close before) (class-close before)))) '(c-basic-offset 2) '(auto-save-default nil) '(make-backup-files nil)) (custom-set-faces) If you use Emacs, this implies that: - Use 2 spaces for indentation, not tabulation ("\t") characters. - Unless a block is entirely in one line, braces before and after a block should be on their own line, with the same indentation as the block they're in. Basically, we should use the "MacOS" coding standard. Sample code with this standard is available in CVS, and also on Apple's web site (http://developer.apple.com/samplecode/). One thing that is not obvious (because they don't always do it) is that: Function(arg1, arg2) new Class(arg) if (!value) while (value) for (;;) That is, a space before the next parenthesis block ONLY if it's not a function. I chose the "MacOS" standard because it's a no-nonsence one, and there's no crazy, hard to remember rules. Actually, the rule is to NOT use any of the rules you may have seen from other coding standards (especially the Microsoft one), except those defined here. (P.S.: You may want to remove the "'(auto-save-default nil)" and "'(make-backup-files nil)" if you do want to make automatic backups. Personally, I hate them, since Linux never crashes and I eventually delete them.) CVS Here, replace "username" with your Sourceforge user name. First, set up your ~/.bashrc (or ~/.cshrc) to have this: export CVSROOT=':ext:use...@cv...:/cvsroot/anet' export CVS_RSH=ssh (use setenv if you're using csh) Then, use ssh-keygen. When the key is generated, copy-paste the key from ~/.ssh/identity.pub to your account options in SourceForge (CVS/SSH keys). You may have to wait an hour or two before it's synched with their servers. Make a file ~/.cvsrc that contains this: checkout -P Now, when you want to to a session of checkins and checkouts, do "ssh-agent bash" (or "ssh-agent csh"), then do "ssh-add". Until you do "exit", CVS will never ask you for your password! Important notes: - To make a new directory, make a new file in the directory (like ".dont_remove"), and add/checkin that file. - Import is recursive and starts at the CURRENT DIRECTORY, whatever is the module name passed as an argument (I learned that the hard way). - Do not checkout the CVSROOT module unless you REALLY know what you're doing. You can mess our entire project with that. - Benad |