repository.html revision b8e80941
1<!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> 9 10<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 17<h1>Code Repository</h1> 18 19<p> 20Mesa uses <a href="https://git-scm.com">git</a> 21as its source code management system. 22</p> 23 24<p> 25The master git repository is hosted on 26<a href="https://www.freedesktop.org">freedesktop.org</a>. 27</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 38<a href="https://gitlab.freedesktop.org/mesa/mesa" 39>browse the main Mesa git repository</a> and the 40<a href="https://gitlab.freedesktop.org/mesa/demos" 41>Mesa demos and tests git repository</a>. 42</p> 43 44 45<h2 id="anonymous">Anonymous git Access</h2> 46 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 https://gitlab.freedesktop.org/mesa/mesa.git 56 </pre> 57<li>Later, you can update your tree from the master repository with: 58 <pre> 59 git pull origin 60 </pre> 61<li>If you also want the Mesa demos/tests repository: 62 <pre> 63 git clone https://gitlab.freedesktop.org/mesa/demos.git 64 </pre> 65</ol> 66 67 68<h2 id="developer">Developer git Access</h2> 69 70<p> 71If you wish to become a Mesa developer with git-write privilege, please 72follow this procedure: 73</p> 74<ol> 75<li>Subscribe to the 76<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">mesa-dev</a> 77mailing list. 78<li>Start contributing to the project by 79<a href="submittingpatches.html" target="_parent">submitting patches</a> to 80the 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="https://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> 99 100<p> 101Once your account is established, you can update your push url to use SSH: 102<pre> 103git remote set-url --push <em>origin</em> git@gitlab.freedesktop.org:mesa/mesa.git 104</pre> 105 106You can also use <a href="https://gitlab.freedesktop.org/profile/personal_access_tokens">personal access tokens</a> 107to push over HTTPS instead (useful for people behind strict proxies). 108In this case, create a token, and put it in the url as shown here: 109<pre> 110git remote set-url --push <em>origin</em> https://<em>USER</em>:<em>TOKEN</em>@gitlab.freedesktop.org/mesa/mesa.git 111</pre> 112 113 114<h2>Windows Users</h2> 115 116<p> 117If you're <a href="https://git.wiki.kernel.org/index.php/WindowsInstall"> 118using git on Windows</a> you'll want to enable automatic CR/LF conversion in 119your local copy of the repository: 120</p> 121<pre> 122 git config --global core.autocrlf true 123</pre> 124 125<p> 126This will cause git to convert all text files to CR+LF on checkout, 127and to LF on commit. 128</p> 129<p> 130Unix users don't need to set this option. 131</p> 132<br> 133 134 135<h2>Development Branches</h2> 136 137<p> 138At any given time, there may be several active branches in Mesa's 139repository. 140Generally, <tt>master</tt> contains the latest development (unstable) 141code while a branch has the latest stable code. 142</p> 143 144<p> 145The command <code>git branch</code> will list all available branches. 146</p> 147 148<p> 149Questions about branch status/activity should be posted to the 150mesa-dev mailing list. 151</p> 152 153<h2>Developer Git Tips</h2> 154 155<ol> 156<li>Setting up to edit the master branch 157<p> 158If you try to do a pull by just saying<code> git pull </code> 159and git complains that you have not specified a 160branch, try: 161<pre> 162 git config branch.master.remote origin 163 git config branch.master.merge master 164</pre> 165<p> 166Otherwise, you have to say<code> git pull origin master </code> 167each time you do a pull. 168</p> 169<li>Small changes to master 170<p> 171If you are an experienced git user working on substantial modifications, 172you are probably 173working on a separate branch and would rebase your branch prior to 174merging with master. 175But for small changes to the master branch itself, 176you also need to use the rebase feature in order to avoid an 177unnecessary and distracting branch in master. 178</p> 179<p> 180If it has been awhile since you've done the initial clone, try 181<pre> 182 git pull 183</pre> 184<p> 185to get the latest files before you start working. 186</p> 187<p> 188Make your changes and use 189<pre> 190 git add <files to commit> 191 git commit 192</pre> 193<p> 194to get your changes ready to push back into the fd.o repository. 195</p> 196<p> 197It is possible (and likely) that someone has changed master since 198you did your last pull. Even if your changes do not conflict with 199their changes, git will make a fast-forward 200merge branch, branching from the point in time 201where you did your last pull and merging it to a point after the other changes. 202</p> 203<p> 204To avoid this, 205<pre> 206 git pull --rebase 207 git push 208</pre> 209<p> 210If you are familiar with CVS or similar system, this is similar to doing a 211<code> cvs update </code> in order to update your source tree to 212the current repository state, instead of the time you did the last update. 213(CVS doesn't work like git in this respect, but this is easiest way 214to explain it.) 215<br> 216In any case, your repository now looks like you made your changes after 217all the other changes. 218</p> 219<p> 220If the rebase resulted in conflicts or changes that could affect 221the proper operation of your changes, you'll need to investigate 222those before doing the push. 223</p> 224<p> 225If you want the rebase action to be the default action, then 226<pre> 227 git config branch.master.rebase true 228 git config --global branch.autosetuprebase=always 229</pre> 230<p> 231See <a href="https://www.eecs.harvard.edu/~cduan/technical/git/">Understanding Git Conceptually</a> for a fairly clear explanation about all of this. 232</p> 233</ol> 234 235</div> 236</body> 237</html> 238