CVS walk through and spins in IRC
jonathan.roberts.uk at googlemail.com
Thu Jun 7 19:30:43 UTC 2007
Here's the log from the lesson:
19:17 < couf> <lesson>
19:18 < couf> so today, I'll try to give a rundown of CVS and maybe start off
19:19 < couf> basicly, a cvs workflow starts with a checkout, editing your
files and committing them back to the server
19:20 < couf> cvs needs to know, where to find the server and on which path it
should look on that server, this is called the CVSROOT
19:20 < couf> in FDP's case the cvsroot is:
19:21 < couf> where <username> is your account name in the fedora account system
19:21 -!- BobJensen-Away is now known as BobJensen
19:21 < JonRob> ok, and what is the ":ext:" bit?
19:22 < couf> the ext bit tells the server how to authenticate the user
19:22 < JonRob> oh ok, cool
19:22 < couf> in fedora's case we use ssh
19:22 < couf> which should be defined in CVS_RSH
19:22 < couf> so first step: checkout a directory-tree from cvs
19:23 < couf> this just downloads all files that exist in that tree on the
server, with information that lets you know which version of a
file you've downloaded
19:24 < couf> you can download a whole cvs repository, a module or a specific
19:24 < couf> s/download/checkout
19:24 < couf> if you don't have, don't download the whole repository, keep to a
module or a directory
19:25 < couf> a module is a configured item that tells cvs to grab directory
foo and bar if need be
19:25 < couf> so let's cut to the chase: checking out the example-tutorial
19:26 < couf> cvs doesn't know our CVSROOT, nor our CVS_RSH so they need to be
set as environnemnt variables
19:26 < couf> export CVSROOT=:ext:<username>@cvs.fedoraproject.org:/cvs/docs
19:26 < couf> export CVS_RSH=ssh
19:27 < couf> if everything goes well, you should be able to issue "cvs co -c"
which will show the possible modules
19:28 < couf> JonRob: with me so far?
19:28 < JonRob> nuts...got an error :S
19:28 < couf> what's the error?
19:28 < JonRob> permission denied (publickey,keyboard-interactive).
19:29 < couf> ah, are you part of the cvsdocs group in FAS?
19:29 < JonRob> good question!
19:29 < JonRob> i don't think so
19:30 < couf> heh, you probably should do that, otherwise you can't commit
anything to the repository
19:30 < JonRob> i'm just logging in now
19:31 < JonRob> ok, i've added cvsdocs to my account
19:31 < couf> jonrob right?
19:31 < couf> duuh probably
19:31 < JonRob> same error
19:31 < JonRob> :(
19:32 < couf> okay, yeah that'll change in an hour, I just approved you
19:32 < couf> or better on top of the hour
19:32 < JonRob> lol ok, i'm taking detailed notes so we should be good to keep
19:33 < couf> anyways if you want to try it, you could you anonymous login,
cvsroot is :pserver:anonymous at cvs.fedoraproject.org:/cvs/docs
19:33 < couf> cool
19:34 < couf> so if you want to checkout a module, you look up it's name with
"cvs co -c"
19:34 < couf> now you can "cvs co <modulename>"
19:35 -!- Sonar_Guy [n=sglaser at fedora/sonarguy] has quit ["Sonar_Guy has Left
19:35 < couf> ow yeah, the modulename is the first word on a line :-)
19:35 < JonRob> cool
19:36 < JonRob> (cvs co -c seems very slow?)
19:36 < couf> this will checkout (download) the module, eg "cvs co
example-tutorial" will get the example tutorial and put it in a
directory with the same name
19:36 < couf> JonRob: not really slow here
19:36 < JonRob> hmm
19:37 < JonRob> OK, well keep going...will figure out details like that later!
19:37 < couf> okay, so what you've got now is known as a working copy of the
19:37 < couf> you can edit every file in there, add new ones, del, move, copy
19:38 < couf> keeping it up-to-date with the cvs server is wise
19:39 < couf> you do this by going into the directory and using "cvs up"
19:39 < couf> this will check the file versions on the server and locally and
update accordinly (download the newest version)
19:40 < couf> if you've edited a file, that's changed on the server aswell,
it'll try to merge the edits
19:40 < couf> if you've got the luck of editing in the same part of the file
this'll give a conflict, which must be resolved as fast as
19:41 * couf notes: conflicts don't really happen around here
19:41 < couf> so once you're done editing, or just updated a file
19:42 < couf> you should commit it back to the repository
19:42 < couf> if you've added files, you should use "cvs add <filename1>
<filename2> ..." to let cvs know these files should become part
of the repo
19:43 < JonRob> from the appropriate local directory?
19:43 < couf> if you want to remove files, don't just "rm"-delete them, use
"cvs remove <filename>"
19:43 < couf> JonRob: not per se, but best pratice
19:43 < JonRob> ok
19:44 < couf> what's also a best practice is doing an update before committing,
as to avoid conflicts when committing
19:44 < couf> so how to commit: 'cvs co -m "<message>" <filename1> <filename2>'
19:45 < JonRob> couf: one second...
19:45 < JonRob> to do an update: cvs up
19:45 < JonRob> ?
19:45 < couf> jep
19:45 < JonRob> and that won't erase your changes?
19:45 < couf> no, it checks for local modifications, and keeps does
19:45 < couf> s/does/thoose
19:46 < JonRob> heh, cool
19:47 < couf> okay so <message> is basicly a message you enter explaining your
19:47 < JonRob> (cool - cvs co -c just worked!)
19:47 < couf> neet :)
19:48 < couf> ow hang on, made a mistake above: it shoud be 'cvs ci -m
"<message>" <filename1> <filename2>'
19:48 < couf> co = checkout, ci = commit
19:48 < couf> you can use "cvs checkout" and "cvs commit" aswell btw
19:48 < couf> and "cvs update"
19:48 < JonRob> ok
19:49 < couf> somewhat clear?
19:49 < JonRob> yeah crystal
19:49 < couf> cool :-)
19:50 < JonRob> <filename1> <filename2> - do they commit specific files?
19:50 < JonRob> can you commit entire directory?
19:50 < couf> you can, yes
19:50 < couf> which is sometimes easy, iirc it even works recursivly
19:51 < JonRob> awesome - and you don't need to specify -r or anything?
19:51 < couf> ah no, it's -R
19:51 < couf> damm, that's why it never worked :-/
19:52 < couf> heh, ow well, now I know again
19:52 < JonRob> ha yeah...you're learning too :D
19:52 < couf> so to summurize: first check out a directory (a one-time thing)
19:52 < couf> -> keep your checkout's up to date with "cvs up"
19:53 < couf> -> editing files
19:53 < couf> (like you do with normal files)
19:53 < couf> -> adding a new file: cvs add <filename>
19:53 < couf> -> deleting a file: cvs remove <filename>
19:53 < couf> -> committing: cvs ci -m "<message>" <foo>
19:54 < couf> there's a lot more to cvs (tags, branches) but we don't really
use that around here
19:54 < JonRob> ok cool
19:55 < JonRob> will cross that bridge if i ever need it
19:55 < couf> heh, yeah it took some time before I started to get the hang of
thoose concepts aswell
19:56 < couf> but in the end: what you know now is quite standard for every
revision control system
19:56 -!- |DrJef| [n=onefjef at fedora/Jef] has quit ["Leaving"]
19:56 < couf> as subversion, git, hg, bazaar, ...
19:56 < JonRob> *awesome*
19:56 < couf> the concept is the same, the name of the tool changes a bit
19:57 < couf> ow yeah, one more thing: you can always see the contents of the
cvs at: http://cvs.fedoraproject.org/viewcvs/?root=docs
19:57 < JonRob> that gives you something similar to cvs co -c?
19:58 < couf> not really, that's the actual repository layout
19:58 < couf> not everything has been made a module
19:58 < couf> it's largely old stuff that didn't make it into modules, so not
to worry about that
19:58 < JonRob> oh ok...if i did need something that wasn't a module
19:58 < JonRob> i could check at http://...
19:59 < couf> yeah, and use the name of the directory as the checkout
19:59 < JonRob> cool
20:00 < couf> heh, any questions ;-)?
20:00 < JonRob> umm no i think you got it all covered!
20:01 < JonRob> oh, what about commiting something new to cvs?
20:01 < JonRob> i.e. the spins stuff
20:01 < couf> ah, right
20:01 < couf> actually you need to checkout everything (I think) to do this
20:02 < couf> but I'll save you that work
20:02 < couf> you should actually create a top-level directory to hold
everything beneath it
20:02 < couf> so that's "cvs add <dirname>"
20:03 < couf> adding a directory committs it directly aswell
20:03 < couf> something that doesn't happen to a file, which you have to commit
20:03 < JonRob> ok
20:03 < couf> so I'll add the top-level directory for now, and a basic structure
20:04 < JonRob> and then i can just commit into that?
20:04 < couf> yep
20:04 < JonRob> ok awesome thanks :D
20:04 < couf> so how do you want that directory to be called?
20:05 < couf> respin-guide?
20:05 < couf> or revisor-guide?
20:05 < JonRob> yeah that's good, then we can add docs for livecd-tools and
pungi to their if need be?
20:05 < JonRob> there*
20:05 < couf> ah right, so respin it shall be
20:06 < couf> ah btw, you should be subscribed to the fedora-docs-commit list
20:07 < JonRob> oh ok, i'll do that now
20:07 < JonRob> what does that do?
20:07 < couf> that sends a mail everytime a cvs commit happens
20:07 < JonRob> oo ok
20:07 < couf> with a diff showing what changed for a file
20:08 < JonRob> like wiki subscribed pages
20:08 < couf> something like that yeah
20:08 < JonRob> cool
20:08 < couf> so what language: en_US or en_UK? :-)
20:09 < JonRob> heh, go with en_US, will make it easier for everyone else and i
think i get it right most of the time
20:10 < couf> stickster_work, quaid: could you guys add respin-guide to the
modules, I can't edit the CVSROOT
20:10 < couf> JonRob: I've to go for a couple of minutes
20:11 < JonRob> couf: no problem
20:11 < couf> bb in 10 min
20:11 < JonRob> ok...i don't have too much longer this eve...
20:11 < couf> ok, maybe we should close this lesson, and continue another time?
20:11 < JonRob> but i feel like i get cvs now - at least until i start using it
and finding places i get stuck :p
20:11 < JonRob> if that's ok?
20:11 < couf> yeah, no problem
20:12 < couf> if you get stuck, just jump in and ask
20:12 < JonRob> i'll do the log and put it on the list
20:12 < couf> all right cool
20:12 * couf closes
20:12 < couf> </lesson>
Hope it's OK - never done a log before (evening of firsts for me :D)
More information about the fedora-docs-list