blob: 1fb88bf71737a1f653100d0d6d9fea7a5d326060 [file] [log] [blame]
Andreas Bollecd5c7c2012-06-12 09:05:03 +02001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html lang="en">
3<head>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8">
5 <title>Code Repository</title>
6 <link rel="stylesheet" type="text/css" href="mesa.css">
7</head>
8<body>
Brian464e3632006-12-05 16:14:14 -07009
Andreas Bollb5da52a2012-09-18 18:57:02 +020010<div class="header">
11 <h1>The Mesa 3D Graphics Library</h1>
12</div>
13
14<iframe src="contents.html"></iframe>
15<div class="content">
16
Brian464e3632006-12-05 16:14:14 -070017<h1>Code Repository</h1>
18
19<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +020020Mesa uses <a href="http://git-scm.com">git</a>
Brian464e3632006-12-05 16:14:14 -070021as its source code management system.
Brian464e3632006-12-05 16:14:14 -070022</p>
23
Andreas Bolldf2be222012-06-12 09:05:22 +020024<p>
Brian464e3632006-12-05 16:14:14 -070025The master git repository is hosted on
Andreas Bolla73c59b2012-09-18 19:31:28 +020026<a href="http://www.freedesktop.org">freedesktop.org</a>.
Brian464e3632006-12-05 16:14:14 -070027</p>
28
29<p>
30You may access the repository either as an
31<a href="#anonymous">anonymous user</a> (read-only) or as a
32<a href="#developer">developer</a>
33(read/write).
34</p>
35
36<p>
37You may also
Brian Paulca1b2da2012-02-16 13:35:02 -070038<a href="http://cgit.freedesktop.org/mesa/mesa/"
Andreas Bolla73c59b2012-09-18 19:31:28 +020039>browse the main Mesa git repository</a> and the
Brian Paul7ba1a872010-06-04 17:47:06 -060040<a href="http://cgit.freedesktop.org/mesa/demos"
Andreas Bolla73c59b2012-09-18 19:31:28 +020041>Mesa demos and tests git repository</a>.
Brian464e3632006-12-05 16:14:14 -070042</p>
43
44
Andreas Bollcc418882012-06-12 09:05:33 +020045<h2 id="anonymous">Anonymous git Access</h2>
Brian464e3632006-12-05 16:14:14 -070046
47<p>
48To get the Mesa sources anonymously (read-only):
49</p>
50
51<ol>
52<li>Install the git software on your computer if needed.<br><br>
53<li>Get an initial, local copy of the repository with:
54 <pre>
55 git clone git://anongit.freedesktop.org/git/mesa/mesa
56 </pre>
57<li>Later, you can update your tree from the master repository with:
58 <pre>
59 git pull origin
60 </pre>
Brian Paul7ba1a872010-06-04 17:47:06 -060061<li>If you also want the Mesa demos/tests repository:
62 <pre>
63 git clone git://anongit.freedesktop.org/git/mesa/demos
64 </pre>
Brian464e3632006-12-05 16:14:14 -070065</ol>
66
67
Andreas Bollcc418882012-06-12 09:05:33 +020068<h2 id="developer">Developer git Access</h2>
Brian464e3632006-12-05 16:14:14 -070069
70<p>
Brian Paule9159032016-04-25 10:13:32 -060071If you wish to become a Mesa developer with git-write privilege, please
72follow this procedure:
Brian464e3632006-12-05 16:14:14 -070073</p>
Brian Paule9159032016-04-25 10:13:32 -060074<ol>
75<li>Subscribe to the
76<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">mesa-dev</a>
77mailing list.
Emil Velikov49ac7322016-06-29 13:40:03 +010078<li>Start contributing to the project by
79<a href="submittingpatches.html" target="_parent">submitting patches</a> to
Brian Paule9159032016-04-25 10:13:32 -060080the mesa-dev list. Specifically,
81<ul>
82<li>Use <code>git send-mail</code> to post your patches to mesa-dev.
83<li>Wait for someone to review the code and give you a <code>Reviewed-by</code>
84statement.
85<li>You'll have to rely on another Mesa developer to push your initial patches
86after they've been reviewed.
87</ul>
88<li>After you've demonstrated the ability to write good code and have had
89a dozen or so patches accepted you can apply for an account.
90<li>Occasionally, but rarely, someone may be given a git account sooner, but
91only if they're being supervised by another Mesa developer at the same
92organization and planning to work in a limited area of the code or on a
93separate branch.
94<li>To apply for an account, follow
95<a href="http://www.freedesktop.org/wiki/AccountRequests">these directions</a>.
96It's also appreciated if you briefly describe what you intend to do (work
97on a particular driver, add a new extension, etc.) in the bugzilla record.
98</ol>
Brian464e3632006-12-05 16:14:14 -070099
100<p>
101Once your account is established:
102</p>
103
104<ol>
Brian464e3632006-12-05 16:14:14 -0700105<li>Get an initial, local copy of the repository with:
106 <pre>
107 git clone git+ssh://username@git.freedesktop.org/git/mesa/mesa
108 </pre>
109 Replace <em>username</em> with your actual login name.<br><br>
110<li>Later, you can update your tree from the master repository with:
111 <pre>
112 git pull origin
113 </pre>
Brian Paul7ba1a872010-06-04 17:47:06 -0600114<li>If you also want the Mesa demos/tests repository:
115 <pre>
116 git clone git+ssh://username@git.freedesktop.org/git/mesa/demos
117 </pre>
Brian464e3632006-12-05 16:14:14 -0700118</ol>
119
120
Andreas Boll210a27d2012-06-12 09:05:36 +0200121<h2>Windows Users</h2>
Brianddbfa8c2008-02-28 08:03:04 -0700122
123<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200124If you're <a href="http://git.wiki.kernel.org/index.php/WindowsInstall">
Brianddbfa8c2008-02-28 08:03:04 -0700125using git on Windows</a> you'll want to enable automatic CR/LF conversion in
126your local copy of the repository:
127</p>
128<pre>
129 git config --global core.autocrlf true
130</pre>
131
132<p>
133This will cause git to convert all text files to CR+LF on checkout,
134and to LF on commit.
135</p>
136<p>
137Unix users don't need to set this option.
138</p>
139<br>
140
141
Andreas Bollcc418882012-06-12 09:05:33 +0200142<h2>Development Branches</h2>
Brian464e3632006-12-05 16:14:14 -0700143
144<p>
145At any given time, there may be several active branches in Mesa's
146repository.
147Generally, the trunk contains the latest development (unstable)
148code while a branch has the latest stable code.
149</p>
150
151<p>
Brian18e9ca52007-02-20 09:24:06 -0700152The command <code>git-branch</code> will list all available branches.
153</p>
154
155<p>
156Questions about branch status/activity should be posted to the
157mesa3d-dev mailing list.
Brian464e3632006-12-05 16:14:14 -0700158</p>
159
Andreas Boll210a27d2012-06-12 09:05:36 +0200160<h2>Developer Git Tips</h2>
Karl Schultz207ad942010-02-11 10:54:18 -0700161
162<ol>
163<li>Setting up to edit the master branch
164<p>
165If you try to do a pull by just saying<code> git pull </code>
166and git complains that you have not specified a
167branch, try:
168<pre>
169 git config branch.master.remote origin
170 git config branch.master.merge master
171</pre>
Andreas Bolldf2be222012-06-12 09:05:22 +0200172<p>
Karl Schultz207ad942010-02-11 10:54:18 -0700173Otherwise, you have to say<code> git pull origin master </code>
174each time you do a pull.
175</p>
176<li>Small changes to master
177<p>
Nathan Kidd0691b372014-01-03 16:44:00 -0700178If you are an experienced git user working on substantial modifications,
Karl Schultz207ad942010-02-11 10:54:18 -0700179you are probably
180working on a separate branch and would rebase your branch prior to
181merging with master.
182But for small changes to the master branch itself,
183you also need to use the rebase feature in order to avoid an
184unnecessary and distracting branch in master.
185</p>
186<p>
187If it has been awhile since you've done the initial clone, try
188<pre>
189 git pull
190</pre>
Andreas Bolldf2be222012-06-12 09:05:22 +0200191<p>
Karl Schultz207ad942010-02-11 10:54:18 -0700192to get the latest files before you start working.
193</p>
194<p>
195Make your changes and use
196<pre>
197 git add &lt;files to commit&gt;
198 git commit
199</pre>
Andreas Bolldf2be222012-06-12 09:05:22 +0200200<p>
Karl Schultz207ad942010-02-11 10:54:18 -0700201to get your changes ready to push back into the fd.o repository.
202</p>
203<p>
204It is possible (and likely) that someone has changed master since
205you did your last pull. Even if your changes do not conflict with
206their changes, git will make a fast-forward
207merge branch, branching from the point in time
208where you did your last pull and merging it to a point after the other changes.
209</p>
210<p>
211To avoid this,
212<pre>
213 git pull --rebase
214 git push
215</pre>
Andreas Bolldf2be222012-06-12 09:05:22 +0200216<p>
Karl Schultz207ad942010-02-11 10:54:18 -0700217If you are familiar with CVS or similar system, this is similar to doing a
218<code> cvs update </code> in order to update your source tree to
219the current repository state, instead of the time you did the last update.
220(CVS doesn't work like git in this respect, but this is easiest way
221to explain it.)
Andreas Bolldf2be222012-06-12 09:05:22 +0200222<br>
Karl Schultz207ad942010-02-11 10:54:18 -0700223In any case, your repository now looks like you made your changes after
224all the other changes.
225</p>
226<p>
227If the rebase resulted in conflicts or changes that could affect
228the proper operation of your changes, you'll need to investigate
229those before doing the push.
230</p>
231<p>
232If you want the rebase action to be the default action, then
233<pre>
234 git config branch.master.rebase true
235 git config --global branch.autosetuprebase=always
236</pre>
237<p>
Andreas Bolla73c59b2012-09-18 19:31:28 +0200238See <a href="http://www.eecs.harvard.edu/~cduan/technical/git/">Understanding Git Conceptually</a> for a fairly clear explanation about all of this.
Karl Schultz207ad942010-02-11 10:54:18 -0700239</p>
240</ol>
Brian464e3632006-12-05 16:14:14 -0700241
Andreas Bollb5da52a2012-09-18 18:57:02 +0200242</div>
Brian464e3632006-12-05 16:14:14 -0700243</body>
244</html>