| Andreas Boll | ecd5c7c | 2012-06-12 09:05:03 +0200 | [diff] [blame] | 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> |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 9 | |
| 10 | <h1>Code Repository</h1> |
| 11 | |
| 12 | <p> |
| Brian Paul | d23fefe | 2010-02-11 09:02:53 -0700 | [diff] [blame] | 13 | Mesa uses <a href="http://git.or.cz/"target="_parent">git</a> |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 14 | as its source code management system. |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 15 | </p> |
| 16 | |
| Andreas Boll | df2be22 | 2012-06-12 09:05:22 +0200 | [diff] [blame] | 17 | <p> |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 18 | The master git repository is hosted on |
| 19 | <a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>. |
| 20 | </p> |
| 21 | |
| 22 | <p> |
| 23 | You may access the repository either as an |
| 24 | <a href="#anonymous">anonymous user</a> (read-only) or as a |
| 25 | <a href="#developer">developer</a> |
| 26 | (read/write). |
| 27 | </p> |
| 28 | |
| 29 | <p> |
| 30 | You may also |
| Brian Paul | ca1b2da | 2012-02-16 13:35:02 -0700 | [diff] [blame] | 31 | <a href="http://cgit.freedesktop.org/mesa/mesa/" |
| Brian Paul | 7ba1a87 | 2010-06-04 17:47:06 -0600 | [diff] [blame] | 32 | target="_parent">browse the main Mesa git repository</a> and the |
| 33 | <a href="http://cgit.freedesktop.org/mesa/demos" |
| 34 | target="_parent">Mesa demos and tests git repository</a>. |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 35 | </p> |
| 36 | |
| 37 | |
| Andreas Boll | cc41888 | 2012-06-12 09:05:33 +0200 | [diff] [blame] | 38 | <h2 id="anonymous">Anonymous git Access</h2> |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 39 | |
| 40 | <p> |
| 41 | To get the Mesa sources anonymously (read-only): |
| 42 | </p> |
| 43 | |
| 44 | <ol> |
| 45 | <li>Install the git software on your computer if needed.<br><br> |
| 46 | <li>Get an initial, local copy of the repository with: |
| 47 | <pre> |
| 48 | git clone git://anongit.freedesktop.org/git/mesa/mesa |
| 49 | </pre> |
| 50 | <li>Later, you can update your tree from the master repository with: |
| 51 | <pre> |
| 52 | git pull origin |
| 53 | </pre> |
| Brian Paul | 7ba1a87 | 2010-06-04 17:47:06 -0600 | [diff] [blame] | 54 | <li>If you also want the Mesa demos/tests repository: |
| 55 | <pre> |
| 56 | git clone git://anongit.freedesktop.org/git/mesa/demos |
| 57 | </pre> |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 58 | </ol> |
| 59 | |
| 60 | |
| Andreas Boll | cc41888 | 2012-06-12 09:05:33 +0200 | [diff] [blame] | 61 | <h2 id="developer">Developer git Access</h2> |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 62 | |
| 63 | <p> |
| 64 | Mesa developers need to first have an account on |
| 65 | <a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>. |
| 66 | To get an account, please ask Brian or the other Mesa developers for |
| 67 | permission. |
| 68 | Then, if there are no objections, follow this |
| 69 | <a href="http://www.freedesktop.org/wiki/AccountRequests" target="_parent"> |
| 70 | procedure</a>. |
| 71 | </p> |
| 72 | |
| 73 | <p> |
| 74 | Once your account is established: |
| 75 | </p> |
| 76 | |
| 77 | <ol> |
| 78 | <li>Install the git software on your computer if needed.<br><br> |
| 79 | <li>Get an initial, local copy of the repository with: |
| 80 | <pre> |
| 81 | git clone git+ssh://username@git.freedesktop.org/git/mesa/mesa |
| 82 | </pre> |
| 83 | Replace <em>username</em> with your actual login name.<br><br> |
| 84 | <li>Later, you can update your tree from the master repository with: |
| 85 | <pre> |
| 86 | git pull origin |
| 87 | </pre> |
| Brian Paul | 7ba1a87 | 2010-06-04 17:47:06 -0600 | [diff] [blame] | 88 | <li>If you also want the Mesa demos/tests repository: |
| 89 | <pre> |
| 90 | git clone git+ssh://username@git.freedesktop.org/git/mesa/demos |
| 91 | </pre> |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 92 | </ol> |
| 93 | |
| 94 | |
| Andreas Boll | 210a27d | 2012-06-12 09:05:36 +0200 | [diff] [blame^] | 95 | <h2>Windows Users</h2> |
| Brian | ddbfa8c | 2008-02-28 08:03:04 -0700 | [diff] [blame] | 96 | |
| 97 | <p> |
| 98 | If you're <a href="http://git.or.cz/gitwiki/WindowsInstall" target="_parent"> |
| 99 | using git on Windows</a> you'll want to enable automatic CR/LF conversion in |
| 100 | your local copy of the repository: |
| 101 | </p> |
| 102 | <pre> |
| 103 | git config --global core.autocrlf true |
| 104 | </pre> |
| 105 | |
| 106 | <p> |
| 107 | This will cause git to convert all text files to CR+LF on checkout, |
| 108 | and to LF on commit. |
| 109 | </p> |
| 110 | <p> |
| 111 | Unix users don't need to set this option. |
| 112 | </p> |
| 113 | <br> |
| 114 | |
| 115 | |
| Andreas Boll | cc41888 | 2012-06-12 09:05:33 +0200 | [diff] [blame] | 116 | <h2>Development Branches</h2> |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 117 | |
| 118 | <p> |
| 119 | At any given time, there may be several active branches in Mesa's |
| 120 | repository. |
| 121 | Generally, the trunk contains the latest development (unstable) |
| 122 | code while a branch has the latest stable code. |
| 123 | </p> |
| 124 | |
| 125 | <p> |
| Brian | 18e9ca5 | 2007-02-20 09:24:06 -0700 | [diff] [blame] | 126 | The command <code>git-branch</code> will list all available branches. |
| 127 | </p> |
| 128 | |
| 129 | <p> |
| 130 | Questions about branch status/activity should be posted to the |
| 131 | mesa3d-dev mailing list. |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 132 | </p> |
| 133 | |
| Andreas Boll | 210a27d | 2012-06-12 09:05:36 +0200 | [diff] [blame^] | 134 | <h2>Developer Git Tips</h2> |
| Karl Schultz | 207ad94 | 2010-02-11 10:54:18 -0700 | [diff] [blame] | 135 | |
| 136 | <ol> |
| 137 | <li>Setting up to edit the master branch |
| 138 | <p> |
| 139 | If you try to do a pull by just saying<code> git pull </code> |
| 140 | and git complains that you have not specified a |
| 141 | branch, try: |
| 142 | <pre> |
| 143 | git config branch.master.remote origin |
| 144 | git config branch.master.merge master |
| 145 | </pre> |
| Andreas Boll | df2be22 | 2012-06-12 09:05:22 +0200 | [diff] [blame] | 146 | <p> |
| Karl Schultz | 207ad94 | 2010-02-11 10:54:18 -0700 | [diff] [blame] | 147 | Otherwise, you have to say<code> git pull origin master </code> |
| 148 | each time you do a pull. |
| 149 | </p> |
| 150 | <li>Small changes to master |
| 151 | <p> |
| 152 | If you are an experienced git user working on substancial modifications, |
| 153 | you are probably |
| 154 | working on a separate branch and would rebase your branch prior to |
| 155 | merging with master. |
| 156 | But for small changes to the master branch itself, |
| 157 | you also need to use the rebase feature in order to avoid an |
| 158 | unnecessary and distracting branch in master. |
| 159 | </p> |
| 160 | <p> |
| 161 | If it has been awhile since you've done the initial clone, try |
| 162 | <pre> |
| 163 | git pull |
| 164 | </pre> |
| Andreas Boll | df2be22 | 2012-06-12 09:05:22 +0200 | [diff] [blame] | 165 | <p> |
| Karl Schultz | 207ad94 | 2010-02-11 10:54:18 -0700 | [diff] [blame] | 166 | to get the latest files before you start working. |
| 167 | </p> |
| 168 | <p> |
| 169 | Make your changes and use |
| 170 | <pre> |
| 171 | git add <files to commit> |
| 172 | git commit |
| 173 | </pre> |
| Andreas Boll | df2be22 | 2012-06-12 09:05:22 +0200 | [diff] [blame] | 174 | <p> |
| Karl Schultz | 207ad94 | 2010-02-11 10:54:18 -0700 | [diff] [blame] | 175 | to get your changes ready to push back into the fd.o repository. |
| 176 | </p> |
| 177 | <p> |
| 178 | It is possible (and likely) that someone has changed master since |
| 179 | you did your last pull. Even if your changes do not conflict with |
| 180 | their changes, git will make a fast-forward |
| 181 | merge branch, branching from the point in time |
| 182 | where you did your last pull and merging it to a point after the other changes. |
| 183 | </p> |
| 184 | <p> |
| 185 | To avoid this, |
| 186 | <pre> |
| 187 | git pull --rebase |
| 188 | git push |
| 189 | </pre> |
| Andreas Boll | df2be22 | 2012-06-12 09:05:22 +0200 | [diff] [blame] | 190 | <p> |
| Karl Schultz | 207ad94 | 2010-02-11 10:54:18 -0700 | [diff] [blame] | 191 | If you are familiar with CVS or similar system, this is similar to doing a |
| 192 | <code> cvs update </code> in order to update your source tree to |
| 193 | the current repository state, instead of the time you did the last update. |
| 194 | (CVS doesn't work like git in this respect, but this is easiest way |
| 195 | to explain it.) |
| Andreas Boll | df2be22 | 2012-06-12 09:05:22 +0200 | [diff] [blame] | 196 | <br> |
| Karl Schultz | 207ad94 | 2010-02-11 10:54:18 -0700 | [diff] [blame] | 197 | In any case, your repository now looks like you made your changes after |
| 198 | all the other changes. |
| 199 | </p> |
| 200 | <p> |
| 201 | If the rebase resulted in conflicts or changes that could affect |
| 202 | the proper operation of your changes, you'll need to investigate |
| 203 | those before doing the push. |
| 204 | </p> |
| 205 | <p> |
| 206 | If you want the rebase action to be the default action, then |
| 207 | <pre> |
| 208 | git config branch.master.rebase true |
| 209 | git config --global branch.autosetuprebase=always |
| 210 | </pre> |
| 211 | <p> |
| 212 | See <a href="http://www.eecs.harvard.edu/~cduan/technical/git/" target="_parent">Understanding Git Conceptually</a> for a fairly clear explanation about all of this. |
| 213 | </p> |
| 214 | </ol> |
| Brian | 464e363 | 2006-12-05 16:14:14 -0700 | [diff] [blame] | 215 | |
| 216 | </body> |
| 217 | </html> |