[go: up one dir, main page]

File: HACKING

package info (click to toggle)
cmus 2.0.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,092 kB
  • ctags: 2,405
  • sloc: ansic: 21,341; sh: 959; makefile: 165
file content (133 lines) | stat: -rw-r--r-- 2,183 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
Coding Style
------------

Use hard tabs. Tabs are _always_ 8 characters wide.

Don't use typedef if not really needed.  So instead of

	typedef struct {
		...
	} foo, *foop;

write this

	struct foo {
		...
	};

Keep style consistent with rest of the code.


Using GIT
---------

Clone my repo

	git clone git://onion.dynserv.net/git/cmus.git cmus

Run following commands in the cmus directory

Keep it up to date

	git pull

View commit log

	git log

What changed?

	# commit log only for pl.c
	git whatchanged pl.c

	# show commit log and diff output from 1.6.7 to HEAD
	git whatchanged -p 1.6.7..

Write an AAC plugin ;)

	# add your personal information to config
	# needed if you want to commit changes
	edit .git/config

	------------- 8< -----------------------------
	[user]
		name = "Random Developer"
		email = "random@site.com"
	------------- 8< -----------------------------

	# it's recommended to have separate branch for your own
	# modifications

	# create a new branch (aac) and switch to it
	git checkout -b aac

	# show current branch
	git branch

	# code code code
	# this is the easy part. do it just for fun [1]
	edit aac.c

	# what files you have changed?
	git status

	# show what you have changed
	git diff

	# add files, or tell git that you have changed some files
	# this marks files for commit
	git-update-index aac.c aac.h

	# when everything is ok, commit
	git commit

	# you can give git-commit the files you want to commit
	git commit foo.c

	# all
	git commit -a

	# update master branch
	# 1) change branch
	git checkout master
	# 2) pull changes
	git pull

	# change back to aac branch
	git checkout aac

	# merge with master
	git pull . master

	# create a patch from top most commit
	# creates 0001-name-of-the-commit.txt
	git format-patch HEAD^..

More: http://www.kernel.org/pub/software/scm/git/docs/everyday.html


Misc
----

If you have sparse installed:

	make C=2

Verbose build:

	make V=2


Patches
-------

Use git-format-patch to generate patches from commits. Alternatively you
can use "diff -up" if you don't want to use git.

Send patches to me: Timo Hirvonen <tihirvon@gmail.com>

---

[1] meaning of 'fun' inverted

vim: tw=72