repository.html revision 848b8605
1848b8605Smrg<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2848b8605Smrg<html lang="en">
3848b8605Smrg<head>
4848b8605Smrg  <meta http-equiv="content-type" content="text/html; charset=utf-8">
5848b8605Smrg  <title>Code Repository</title>
6848b8605Smrg  <link rel="stylesheet" type="text/css" href="mesa.css">
7848b8605Smrg</head>
8848b8605Smrg<body>
9848b8605Smrg
10848b8605Smrg<div class="header">
11848b8605Smrg  <h1>The Mesa 3D Graphics Library</h1>
12848b8605Smrg</div>
13848b8605Smrg
14848b8605Smrg<iframe src="contents.html"></iframe>
15848b8605Smrg<div class="content">
16848b8605Smrg
17848b8605Smrg<h1>Code Repository</h1>
18848b8605Smrg
19848b8605Smrg<p>
20848b8605SmrgMesa uses <a href="http://git-scm.com">git</a>
21848b8605Smrgas its source code management system.
22848b8605Smrg</p>
23848b8605Smrg
24848b8605Smrg<p>
25848b8605SmrgThe master git repository is hosted on
26848b8605Smrg<a href="http://www.freedesktop.org">freedesktop.org</a>.
27848b8605Smrg</p>
28848b8605Smrg
29848b8605Smrg<p>
30848b8605SmrgYou may access the repository either as an
31848b8605Smrg<a href="#anonymous">anonymous user</a> (read-only) or as a
32848b8605Smrg<a href="#developer">developer</a>
33848b8605Smrg(read/write).
34848b8605Smrg</p>
35848b8605Smrg
36848b8605Smrg<p>
37848b8605SmrgYou may also 
38848b8605Smrg<a href="http://cgit.freedesktop.org/mesa/mesa/"
39848b8605Smrg>browse the main Mesa git repository</a> and the
40848b8605Smrg<a href="http://cgit.freedesktop.org/mesa/demos"
41848b8605Smrg>Mesa demos and tests git repository</a>.
42848b8605Smrg</p>
43848b8605Smrg
44848b8605Smrg
45848b8605Smrg<h2 id="anonymous">Anonymous git Access</h2>
46848b8605Smrg
47848b8605Smrg<p>
48848b8605SmrgTo get the Mesa sources anonymously (read-only):
49848b8605Smrg</p>
50848b8605Smrg
51848b8605Smrg<ol>
52848b8605Smrg<li>Install the git software on your computer if needed.<br><br>
53848b8605Smrg<li>Get an initial, local copy of the repository with:
54848b8605Smrg    <pre>
55848b8605Smrg    git clone git://anongit.freedesktop.org/git/mesa/mesa
56848b8605Smrg    </pre>
57848b8605Smrg<li>Later, you can update your tree from the master repository with:
58848b8605Smrg    <pre>
59848b8605Smrg    git pull origin
60848b8605Smrg    </pre>
61848b8605Smrg<li>If you also want the Mesa demos/tests repository:
62848b8605Smrg    <pre>
63848b8605Smrg    git clone git://anongit.freedesktop.org/git/mesa/demos
64848b8605Smrg    </pre>
65848b8605Smrg</ol>
66848b8605Smrg
67848b8605Smrg
68848b8605Smrg<h2 id="developer">Developer git Access</h2>
69848b8605Smrg
70848b8605Smrg<p>
71848b8605SmrgMesa developers need to first have an account on
72848b8605Smrg<a href="http://www.freedesktop.org">freedesktop.org</a>.
73848b8605SmrgTo get an account, please ask Brian or the other Mesa developers for
74848b8605Smrgpermission.
75848b8605SmrgThen, if there are no objections, follow this
76848b8605Smrg<a href="http://www.freedesktop.org/wiki/AccountRequests">
77848b8605Smrgprocedure</a>.
78848b8605Smrg</p>
79848b8605Smrg
80848b8605Smrg<p>
81848b8605SmrgOnce your account is established:
82848b8605Smrg</p>
83848b8605Smrg
84848b8605Smrg<ol>
85848b8605Smrg<li>Install the git software on your computer if needed.<br><br>
86848b8605Smrg<li>Get an initial, local copy of the repository with:
87848b8605Smrg    <pre>
88848b8605Smrg    git clone git+ssh://username@git.freedesktop.org/git/mesa/mesa
89848b8605Smrg    </pre>
90848b8605Smrg    Replace <em>username</em> with your actual login name.<br><br>
91848b8605Smrg<li>Later, you can update your tree from the master repository with:
92848b8605Smrg    <pre>
93848b8605Smrg    git pull origin
94848b8605Smrg    </pre>
95848b8605Smrg<li>If you also want the Mesa demos/tests repository:
96848b8605Smrg    <pre>
97848b8605Smrg    git clone git+ssh://username@git.freedesktop.org/git/mesa/demos
98848b8605Smrg    </pre>
99848b8605Smrg</ol>
100848b8605Smrg
101848b8605Smrg
102848b8605Smrg<h2>Windows Users</h2>
103848b8605Smrg
104848b8605Smrg<p>
105848b8605SmrgIf you're <a href="http://git.wiki.kernel.org/index.php/WindowsInstall">
106848b8605Smrgusing git on Windows</a> you'll want to enable automatic CR/LF conversion in
107848b8605Smrgyour local copy of the repository:
108848b8605Smrg</p>
109848b8605Smrg<pre>
110848b8605Smrg   git config --global core.autocrlf true
111848b8605Smrg</pre>
112848b8605Smrg
113848b8605Smrg<p>
114848b8605SmrgThis will cause git to convert all text files to CR+LF on checkout,
115848b8605Smrgand to LF on commit.
116848b8605Smrg</p>
117848b8605Smrg<p>
118848b8605SmrgUnix users don't need to set this option.
119848b8605Smrg</p>
120848b8605Smrg<br>
121848b8605Smrg
122848b8605Smrg
123848b8605Smrg<h2>Development Branches</h2>
124848b8605Smrg
125848b8605Smrg<p>
126848b8605SmrgAt any given time, there may be several active branches in Mesa's
127848b8605Smrgrepository.
128848b8605SmrgGenerally, the trunk contains the latest development (unstable)
129848b8605Smrgcode while a branch has the latest stable code.
130848b8605Smrg</p>
131848b8605Smrg
132848b8605Smrg<p>
133848b8605SmrgThe command <code>git-branch</code> will list all available branches.
134848b8605Smrg</p>
135848b8605Smrg
136848b8605Smrg<p>
137848b8605SmrgQuestions about branch status/activity should be posted to the
138848b8605Smrgmesa3d-dev mailing list.
139848b8605Smrg</p>
140848b8605Smrg
141848b8605Smrg<h2>Developer Git Tips</h2>
142848b8605Smrg
143848b8605Smrg<ol>
144848b8605Smrg<li>Setting up to edit the master branch
145848b8605Smrg<p>
146848b8605SmrgIf you try to do a pull by just saying<code> git pull </code>
147848b8605Smrgand git complains that you have not specified a
148848b8605Smrgbranch, try:
149848b8605Smrg<pre>
150848b8605Smrg    git config branch.master.remote origin
151848b8605Smrg    git config branch.master.merge master
152848b8605Smrg</pre>
153848b8605Smrg<p>
154848b8605SmrgOtherwise, you have to say<code> git pull origin master </code>
155848b8605Smrgeach time you do a pull.
156848b8605Smrg</p>
157848b8605Smrg<li>Small changes to master
158848b8605Smrg<p>
159848b8605SmrgIf you are an experienced git user working on substantial modifications,
160848b8605Smrgyou are probably
161848b8605Smrgworking on a separate branch and would rebase your branch prior to
162848b8605Smrgmerging with master.
163848b8605SmrgBut for small changes to the master branch itself,
164848b8605Smrgyou also need to use the rebase feature in order to avoid an
165848b8605Smrgunnecessary and distracting branch in master.
166848b8605Smrg</p>
167848b8605Smrg<p>
168848b8605SmrgIf it has been awhile since you've done the initial clone, try
169848b8605Smrg<pre>
170848b8605Smrg    git pull
171848b8605Smrg</pre>
172848b8605Smrg<p>
173848b8605Smrgto get the latest files before you start working.
174848b8605Smrg</p>
175848b8605Smrg<p>
176848b8605SmrgMake your changes and use
177848b8605Smrg<pre>
178848b8605Smrg    git add &lt;files to commit&gt;
179848b8605Smrg    git commit
180848b8605Smrg</pre>
181848b8605Smrg<p>
182848b8605Smrgto get your changes ready to push back into the fd.o repository.
183848b8605Smrg</p>
184848b8605Smrg<p>
185848b8605SmrgIt is possible (and likely) that someone has changed master since
186848b8605Smrgyou did your last pull.  Even if your changes do not conflict with
187848b8605Smrgtheir changes, git will make a fast-forward 
188848b8605Smrgmerge branch, branching from the point in time
189848b8605Smrgwhere you did your last pull and merging it to a point after the other changes.
190848b8605Smrg</p>
191848b8605Smrg<p>
192848b8605SmrgTo avoid this, 
193848b8605Smrg<pre>
194848b8605Smrg    git pull --rebase
195848b8605Smrg    git push
196848b8605Smrg</pre>
197848b8605Smrg<p>
198848b8605SmrgIf you are familiar with CVS or similar system, this is similar to doing a
199848b8605Smrg<code> cvs update </code> in order to update your source tree to
200848b8605Smrgthe current repository state, instead of the time you did the last update.
201848b8605Smrg(CVS doesn't work like git in this respect, but this is easiest way
202848b8605Smrgto explain it.)
203848b8605Smrg<br>
204848b8605SmrgIn any case, your repository now looks like you made your changes after
205848b8605Smrgall the other changes.
206848b8605Smrg</p>
207848b8605Smrg<p>
208848b8605SmrgIf the rebase resulted in conflicts or changes that could affect
209848b8605Smrgthe proper operation of your changes, you'll need to investigate
210848b8605Smrgthose before doing the push.
211848b8605Smrg</p>
212848b8605Smrg<p>
213848b8605SmrgIf you want the rebase action to be the default action, then
214848b8605Smrg<pre>
215848b8605Smrg    git config branch.master.rebase true
216848b8605Smrg    git config --global branch.autosetuprebase=always
217848b8605Smrg</pre>
218848b8605Smrg<p>
219848b8605SmrgSee <a href="http://www.eecs.harvard.edu/~cduan/technical/git/">Understanding Git Conceptually</a> for a fairly clear explanation about all of this.
220848b8605Smrg</p>
221848b8605Smrg</ol>
222848b8605Smrg
223848b8605Smrg</div>
224848b8605Smrg</body>
225848b8605Smrg</html>
226