1c1ab244fSSascha Wildner.\" Copyright (c) 2003,2004 The DragonFly Project. All rights reserved. 2c1ab244fSSascha Wildner.\" 3c1ab244fSSascha Wildner.\" This code is derived from software contributed to The DragonFly Project 4c1ab244fSSascha Wildner.\" by Matthew Dillon <dillon@backplane.com> 5c1ab244fSSascha Wildner.\" 6c1ab244fSSascha Wildner.\" Redistribution and use in source and binary forms, with or without 7c1ab244fSSascha Wildner.\" modification, are permitted provided that the following conditions 8c1ab244fSSascha Wildner.\" are met: 9c1ab244fSSascha Wildner.\" 10c1ab244fSSascha Wildner.\" 1. Redistributions of source code must retain the above copyright 11c1ab244fSSascha Wildner.\" notice, this list of conditions and the following disclaimer. 12c1ab244fSSascha Wildner.\" 2. Redistributions in binary form must reproduce the above copyright 13c1ab244fSSascha Wildner.\" notice, this list of conditions and the following disclaimer in 14c1ab244fSSascha Wildner.\" the documentation and/or other materials provided with the 15c1ab244fSSascha Wildner.\" distribution. 16c1ab244fSSascha Wildner.\" 3. Neither the name of The DragonFly Project nor the names of its 17c1ab244fSSascha Wildner.\" contributors may be used to endorse or promote products derived 18c1ab244fSSascha Wildner.\" from this software without specific, prior written permission. 19c1ab244fSSascha Wildner.\" 20c1ab244fSSascha Wildner.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21c1ab244fSSascha Wildner.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22c1ab244fSSascha Wildner.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23c1ab244fSSascha Wildner.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24c1ab244fSSascha Wildner.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25c1ab244fSSascha Wildner.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 26c1ab244fSSascha Wildner.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27c1ab244fSSascha Wildner.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28c1ab244fSSascha Wildner.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29c1ab244fSSascha Wildner.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 30c1ab244fSSascha Wildner.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31c1ab244fSSascha Wildner.\" SUCH DAMAGE. 32c1ab244fSSascha Wildner.\" 33d5611127SSascha Wildner.Dd March 26, 2009 34c1ab244fSSascha Wildner.Dt COMMITTER 7 35c1ab244fSSascha Wildner.Os 36c1ab244fSSascha Wildner.Sh NAME 37c1ab244fSSascha Wildner.Nm committer 38d5611127SSascha Wildner.Nd instructions and rules for DragonFly committers 39d5611127SSascha Wildner.Sh SETTING UP GIT 40c8757e6eSMatthias SchmidtSee 41c8757e6eSMatthias Schmidt.Xr development 7 42d5611127SSascha Wildneron how to pull a fresh copy of the 435f72456dSSascha Wildner.Dx 44d5611127SSascha Wildner.Xr git 1 45d5611127SSascha Wildnerrepository. 46d5611127SSascha Wildner.Pp 47d5611127SSascha WildnerCommitters have to push to 48d5611127SSascha Wildner.Pa crater.dragonflybsd.org 49d5611127SSascha Wildnervia 50c8757e6eSMatthias Schmidt.Xr ssh 1 . 51d5611127SSascha WildnerIf the system is set up to pull from a 52d5611127SSascha Wildner.Dx 53d5611127SSascha Wildnermirror, a remote entry will have to be set up: 54d5611127SSascha Wildner.Bd -literal -offset indent 55d5611127SSascha Wildnergit remote add crater \\ 56d5611127SSascha Wildner ssh://crater.dragonflybsd.org/repository/git/dragonfly.git 57d5611127SSascha Wildner.Ed 58d5611127SSascha Wildner.Pp 595f72456dSSascha WildnerYour 60c8757e6eSMatthias Schmidt.Pa ~/.gitconfig 61c8757e6eSMatthias Schmidtshould contain at least: 62c1ab244fSSascha Wildner.Bd -literal -offset indent 63c8757e6eSMatthias Schmidt[user] 64c8757e6eSMatthias Schmidt name = Your Name 65c8757e6eSMatthias Schmidt email = <login>@dragonflybsd.org 66c1ab244fSSascha Wildner.Ed 675f72456dSSascha Wildner.Pp 68a0c9baf1SSascha WildnerAlternatively, see the 69a0c9baf1SSascha Wildner.Va user.name 70a0c9baf1SSascha Wildnerand 71a0c9baf1SSascha Wildner.Va user.email 72a0c9baf1SSascha Wildnervariables in 73a0c9baf1SSascha Wildner.Xr git-config 1 . 74a0c9baf1SSascha Wildner.Sh SSH DSA KEYS 75c8757e6eSMatthias SchmidtThe git repository machine is 765f72456dSSascha Wildner.Pa crater.dragonflybsd.org , 775f72456dSSascha Wildnerand the 785f72456dSSascha Wildner.Dx 795f72456dSSascha Wildnerdeveloper machine is 805f72456dSSascha Wildner.Pa leaf.dragonflybsd.org . 815f72456dSSascha WildnerWe create 82c1ab244fSSascha Wildneran account for you on both machines and install your public SSH 83c1ab244fSSascha Wildnerkey to give you access. 84c1ab244fSSascha Wildner.Pp 855f72456dSSascha WildnerYour 865f72456dSSascha Wildner.Pa crater 87d5611127SSascha Wildneraccount is set up for repository access only. 883501b626SSascha WildnerIt can only operate as a git slave and cannot be logged into. 893501b626SSascha WildnerThat is, 905f72456dSSascha Wildner.Pa crater.dragonflybsd.org 915f72456dSSascha Wildneris only used as part of 92c8757e6eSMatthias Schmidt.Nm git Cm push 935f72456dSSascha Wildneroperations. 94c1ab244fSSascha Wildner.Pp 955f72456dSSascha WildnerYour 965f72456dSSascha Wildner.Pa leaf 973501b626SSascha Wildneraccount is a general developer account. 983501b626SSascha WildnerAny 995f72456dSSascha Wildner.Dx 1005f72456dSSascha Wildnerdeveloper can have a 1015f72456dSSascha Wildner.Pa leaf 1025f72456dSSascha Wildneraccount, whether a committer or not. 103c1ab244fSSascha WildnerIt can be useful as a developer rendezvous, 1043501b626SSascha Wildnerhowever. 1053501b626SSascha WildnerFor example, people upload kernel cores to 1065f72456dSSascha Wildner.Pa leaf 1075f72456dSSascha Wildnerso other 1083501b626SSascha Wildnerdevelopers can look at them. 1093501b626SSascha WildnerYou log into your 1105f72456dSSascha Wildner.Pa leaf 1115f72456dSSascha Wildneraccount with: 112a0c9baf1SSascha Wildner.Bd -literal -offset indent 113a0c9baf1SSascha Wildnerssh you@leaf.dragonflybsd.org 114a0c9baf1SSascha Wildner.Ed 115c1ab244fSSascha Wildner.Pp 1165f72456dSSascha WildnerThe rules for account use are in 1175f72456dSSascha Wildner.Pa leaf Ap s 1185f72456dSSascha WildnerMOTD. 119c1ab244fSSascha WildnerIt is very important that you never install a password or create a SSH 1205f72456dSSascha Wildnerkey pair on 1215f72456dSSascha Wildner.Pa leaf 1225f72456dSSascha Wildnerto use to access other machines. 1235f72456dSSascha WildnerBecause non-committers can have 1245f72456dSSascha Wildner.Pa leaf 125a0c9baf1SSascha Wildneraccounts, 1265f72456dSSascha Wildner.Pa leaf 127a0c9baf1SSascha Wildneris not considered a secure machine. 128c1ab244fSSascha Wildner.Sh TESTING COMMIT ACCESS 1295f72456dSSascha WildnerThere is a directory called 1305f72456dSSascha Wildner.Pa /usr/src/test/test . 1315f72456dSSascha WildnerTo test your commit 1323221afbeSHasso Tepperaccess, try making a modification and committing a file in this 133c1ab244fSSascha Wildnerdirectory. 134c8757e6eSMatthias SchmidtTry to push the commit to 135c8757e6eSMatthias Schmidt.Pa crater 136c8757e6eSMatthias Schmidtafterwards. 137c1ab244fSSascha Wildner.Bd -literal -offset indent 138c1ab244fSSascha Wildnercd /usr/src/test/test 139c1ab244fSSascha Wildner(edit something) 140c8757e6eSMatthias Schmidtgit commit file_you_edited 141c8757e6eSMatthias Schmidtgit push crater 142c1ab244fSSascha Wildner.Ed 143163ffa07SSascha Wildner.Sh COMMITTING REAL WORK 1443501b626SSascha WildnerMake modifications as needed. 1453501b626SSascha WildnerFor example, edit files. 1463501b626SSascha WildnerFiles and directories can just be added locally. 147d5611127SSascha WildnerThey are stored in your local copy of the repository and then 148d5611127SSascha Wildnersynchronized with 149d5611127SSascha Wildner.Pa crater Ap s 150d5611127SSascha Wildnerrepository when you 151c8757e6eSMatthias Schmidt.Nm git Cm push . 152d5611127SSascha WildnerWhen adding new files make git aware of them like this: 153c1ab244fSSascha Wildner.Bd -literal -offset indent 154c8757e6eSMatthias Schmidtgit add filename 155c8757e6eSMatthias Schmidtgit commit filename 156c1ab244fSSascha Wildner.Ed 157c1ab244fSSascha Wildner.Pp 158bd43e281SStathis KamperisTo actually push your changes to the repository on 159c8757e6eSMatthias Schmidt.Pa crater , 160c8757e6eSMatthias Schmidtuse: 161c1ab244fSSascha Wildner.Bd -literal -offset indent 162c8757e6eSMatthias Schmidtgit push crater 163c1ab244fSSascha Wildner.Ed 164c1ab244fSSascha Wildner.Pp 1656c31129eSSascha WildnerTo merge bug fixes to other branches (MFC), use 1666c31129eSSascha Wildner.Nm git Cm cherry-pick : 1676c31129eSSascha Wildner.Bd -literal -offset indent 1686c31129eSSascha Wildnergit checkout -b rel2_2 crater/DragonFly_RELEASE_2_2 169c48027e4SSascha Wildnergit cherry-pick <commit> 1706c31129eSSascha Wildnergit push crater rel2_2:DragonFly_RELEASE_2_2 1716c31129eSSascha Wildner.Ed 172b0960c8bSSascha Wildner.Pp 173c8757e6eSMatthias SchmidtDo not set the default remote tag to 174c8757e6eSMatthias Schmidt.Pa origin . 175c8757e6eSMatthias SchmidtIt is set to 176c8757e6eSMatthias Schmidt.Pa crater 177c8757e6eSMatthias Schmidtby default. 178c1ab244fSSascha WildnerThis reduces instances where accidental commits or repository 179c8757e6eSMatthias Schmidtoperations are made on the master repository. 180f5347f42SAlex Hornung.Pp 181f5347f42SAlex HornungIt is recommended to enable the MFC-detection commit hook, so that 182f5347f42SAlex Hornungyou are reminded of MFCing in case certain keywords are detected in 183f5347f42SAlex Hornungthe commit message. To do so, copy the hook into place: 184f5347f42SAlex Hornung.Bd -literal -offset indent 185f5347f42SAlex Hornungcp /usr/src/tools/commit-msg /usr/src/.git/hooks/commit-msg 186f5347f42SAlex Hornung.Ed 187c8757e6eSMatthias Schmidt.Sh STRUCTURE OF COMMIT MESSAGES 188a0c9baf1SSascha WildnerAs many 189a0c9baf1SSascha Wildner.Xr git 1 190a0c9baf1SSascha Wildnertools display the first line of a commit message as a summary, 191a0c9baf1SSascha Wildnerstructure your commit messages like this, if possible: 192c8757e6eSMatthias Schmidt.Bd -literal -offset indent 193875d3e87SNicolas TheryOne line summary of your change (less than 50 characters). 194c8757e6eSMatthias Schmidt 195c8757e6eSMatthias SchmidtMaybe more text here describing your changes in detail (including 196d5611127SSascha Wildnerissue tracker IDs etc). 197c8757e6eSMatthias Schmidt.Ed 198875d3e87SNicolas Thery.Pp 199be4a931bSSascha WildnerTo customize the commit template for 200be4a931bSSascha Wildner.Dx , 201be4a931bSSascha Wildneruse: 202875d3e87SNicolas Thery.Bd -literal -offset indent 203875d3e87SNicolas Therygit config --add commit.template /usr/src/tools/gittemplate 204875d3e87SNicolas Thery.Ed 205c1ab244fSSascha Wildner.Sh DISCUSSING COMMITTABLE WORK BEFOREHAND 206a0c9baf1SSascha WildnerDiscussion prior to committing usually occurs on the 207a0c9baf1SSascha Wildner.Pa kernel@ , 208a0c9baf1SSascha Wildner.Pa submit@ , 209a0c9baf1SSascha Wildneror 210a0c9baf1SSascha Wildner.Pa bugs@ 211a0c9baf1SSascha Wildnermailing lists and depends on the work involved. 212d5611127SSascha WildnerSimple and obvious work such as documentation edits or additions 213a0c9baf1SSascha Wildnerdoesn't really need a heads up. 214c1ab244fSSascha Wildner.Pp 215a0c9baf1SSascha WildnerSimple and obvious bug fixes don't need a heads up either, other than to 216c1ab244fSSascha Wildnersay that you will (or just have) committed the fix, so you don't 2173501b626SSascha Wildnerrace other committers trying to do the same thing. 2183501b626SSascha WildnerUsually the developer most active in a discussion about a bug commits the 219c1ab244fSSascha Wildnerfix, but it isn't considered a big deal. 220c1ab244fSSascha Wildner.Pp 221c1ab244fSSascha WildnerMore complex issues are usually discussed on the lists first. 222c1ab244fSSascha WildnerNon-trivial but straight forward bug fixes usually go through 2235f72456dSSascha Wildnera testing period, where you say something like: 2245f72456dSSascha Wildner.Do 2255f72456dSSascha WildnerHere is a patch 2263501b626SSascha Wildnerto driver BLAH that fixes A, B, and C, please test it. 2273501b626SSascha WildnerIf there are no objections I will commit it next Tuesday. 2285f72456dSSascha Wildner.Dc 2295f72456dSSascha Wildner(usually a week, 230c1ab244fSSascha Wildneror more depending on the complexity of the patch). 231c1ab244fSSascha Wildner.Pp 2323501b626SSascha WildnerNew drivers or utilities are usually discussed. 2333501b626SSascha WildnerCommitters will often commit new work 2345f72456dSSascha Wildner.Em without 2355f72456dSSascha Wildnerhooking it into the buildworld or 236c1ab244fSSascha Wildnerbuildkernel infrastructure in order to be able to continue 237c1ab244fSSascha Wildnerdevelopment on it in piecemeal without having to worry about it 238c1ab244fSSascha Wildnerbreaking buildworld or buildkernel, and then they hook it in as a 2393501b626SSascha Wildnerlast step after they've stabilized it. 2403501b626SSascha WildnerExamples of this include 241c1ab244fSSascha Wildnernew versions of GCC, updates to vendor packages such as bind, 242c1ab244fSSascha Wildnersendmail, etc. 243a0c9baf1SSascha Wildner.Sh SOURCE OWNERSHIP 244a0c9baf1SSascha WildnerAreas within the repository do not 245a0c9baf1SSascha Wildner.Dq belong 246a0c9baf1SSascha Wildnerto any committer. 247c1ab244fSSascha WildnerOften situations will arise where one developer commits work and 248c1ab244fSSascha Wildneranother developer finds an issue with it that needs to be corrected. 249c1ab244fSSascha Wildner.Pp 2503501b626SSascha WildnerAll committed work becomes community property. 2513501b626SSascha WildnerNo developer has a 252a0c9baf1SSascha Wildner.Dq lock 2533501b626SSascha Wildneron any part of the source tree. 2543501b626SSascha WildnerHowever, if a developer is 255c1ab244fSSascha Wildneractively working on a portion of the source tree and you find a bug 256a0c9baf1SSascha Wildneror other issue, courtesy dictates that you post to 257a0c9baf1SSascha Wildner.Pa kernel@ 258a0c9baf1SSascha Wildnerand/or email the developer. 259c1ab244fSSascha Wildner.Pp 260c1ab244fSSascha WildnerThis means that, generally, if you do not see a commit to an area 261c1ab244fSSascha Wildnerof the source tree in the last few weeks, it isn't considered active and 262c1ab244fSSascha Wildneryou don't really need to confer with the developer that made the 263a0c9baf1SSascha Wildnercommit, though you should still post to the 264a0c9baf1SSascha Wildner.Pa kernel@ 265a0c9baf1SSascha Wildnermailing list and, of course, confer with developers when their expertise 266a0c9baf1SSascha Wildneris needed. 267c1ab244fSSascha Wildner.Pp 2683501b626SSascha WildnerOne exception to this rule is documentation. 2693501b626SSascha WildnerIf any developer commits 270*dda92f98SSascha Wildnernew work, the documentation guys have free rein to go in and correct 2715f72456dSSascha Wildner.Xr mdoc 7 2723501b626SSascha Wildnererrors. 2733501b626SSascha WildnerThis is really a convenience as most developers are not 2745f72456dSSascha Wildner.Xr mdoc 7 275a0c9baf1SSascha Wildnergurus and it's a waste of time for the doc guys to post to 276a0c9baf1SSascha Wildner.Pa kernel@ 277a0c9baf1SSascha Wildnerfor all the little corrections they make. 278c1ab244fSSascha Wildner.Sh CONFLICTS 279c96b78ddSSascha WildnerOn the occasion that a major code conflict occurs, for example if two 280c1ab244fSSascha Wildnerpeople are doing major work in the same area of the source tree and forgot 281c1ab244fSSascha Wildnerto collaborate with each other, the project leader will be responsible for 2823501b626SSascha Wildnerresolving the conflict. 2833501b626SSascha WildnerAgain, the repository is considered community 284c1ab244fSSascha Wildnerproperty and it must be acceptable for any developer to be able to work on 285c1ab244fSSascha Wildnerany area of the tree that he or she has an interest in. 286c1ab244fSSascha Wildner.Sh MAJOR ARCHITECTURAL CHANGES 287a0c9baf1SSascha WildnerThis is generally 288a0c9baf1SSascha Wildner.An Matt Dillon Ap s 289a0c9baf1SSascha Wildnerarea of expertise. 290a0c9baf1SSascha WildnerAll major architectural changes must be discussed on the 291a0c9baf1SSascha Wildner.Pa kernel@ 292a0c9baf1SSascha Wildnermailing list and he retains veto power. 293c1ab244fSSascha Wildner.Pp 2943501b626SSascha WildnerThis isn't usually an issue with any work. 2953501b626SSascha WildnerAt best if something 2965f72456dSSascha Wildnerdoesn't look right architecturally he'll chip in with adjustments to 2973501b626SSascha Wildnermake it fit in. 2983501b626SSascha WildnerNothing ever really gets vetoed. 2995f72456dSSascha Wildner.Sh SEE ALSO 300c8e8a2e5SSascha Wildner.Xr git 1 Pq Pa devel/git , 3015f72456dSSascha Wildner.Xr development 7 302