info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Newbie] Committing .. and then?


From: Don Bruder
Subject: Re: [Newbie] Committing .. and then?
Date: Sun, 26 Jul 2009 07:44:33 -0700
User-agent: MT-NewsWatcher/3.5.2 (PPC Mac OS X)

In article <address@hidden>,
 address@hidden wrote:

> Hi,
> Sorry for the newbie question;  I'm reading through some online tutorials
> to try to work this out, but I can't find anything to explain what must be
> a really simple problem.
> 
> I have a directory of files imported into CVS.  I then delete the
> originals, and 'checkout' the same files back into the working directory,
> where I proceed to edit them.  So far, so good?
> 
> When I've changed the file, I save it and 'commit'.  OK, it tells me that
> the changes have been recorded, and if I do cvs log <filename>, the
> comments I added are all there.  Good.
> 
> But, here's what I can't answer: if I want to edit that file again, do I
> have to check it back _out_, before editing it?  When I do 'cvs checkout
> <filename>', I get a message that the module can't be found.  Two
> questions:

The "module not found" result is to be expected - with a basic 
"checkout", you grab everything needed to build a tagged version of the 
project (denoted by the various version tags in the repository) not 
individual files. A "module" generally means "everything needed to build 
a specific version of the project" - source and header files, perhaps 
datasets, a makefile (or equivalent) possibly documentation in the form 
of web pages, PDF files, man pages, or even just plain text files - 
*EVERYTHING* needed to build the project. In practically every case, 
there is more than one file in a module, and all of them "come along" 
with a checkout. 

So long as you haven't wiped out the copy you "checked out", you should 
be good to go to edit it forever. "Checking out" simply means that 
you've grabbed a copy of the "stuff" that's in the repository. Doing so 
does nothing to the repository (or any of the files in it) except copy 
stuff into your working directory, and perhaps note somewhere that 
you've done so. When you "commit", any changes you may have made get put 
in the repository, but unless you take steps to remove it, your "checked 
out" copy (including any changes you "commit"ed) is still sitting in 
your working directory, waiting for you to continue working with it.

 
> 1.  does this mean that I no longer need to checkout the same file?  Even
> if I walk away from my computer and don't touch the file for another week?
> Is it still 'checked in'?  If so, how do I get it back out when I _am_
> ready to edit it again?

Pretty much. It's already sitting there in your working directory. See 
above paragraph. If you *KNOW, BEYOND A DOUBT* that you're the only 
person working on the code, you don't need to do anything special before 
starting to edit. On the other hand, if there's any realistic 
possibility that someone else may have made changes to the repository 
since the last time you did a commit, and you want to stay in sync with 
what's actually in the repository, you're going to need to at least 
update your working directory so that the files you have include their 
changes. Depending on the project/amount of activity it sees, it might 
be better to actually do a full checkout from scratch.
 
> 
> 2.  how do I tell the system 'OK, all done', and that my editing session is
> over, and that I'm off to watch a film, smoke a reefer or go out for a jog?  

The simple answer: You don't. A fundamental concept of software projects 
is "It's never *DONE*, but we have to pay the bills somehow, so we're 
gonna slap a "version 2.1.1.3.199.4A" sticker on it, and ship tomorrow 
afternoon." CVS "understands" this concept, and is open-ended. Using the 
right commands, you can build every version of a project from the first 
time it was committed. And nothing ever "goes away" once you "commit" 
it, even if it does eventually get lopped out of the shipping build - 
Look in the repository's "attic", and you'll find any files that were 
removed from the project at any point 

When you're done working for a while, commit all your changes, then walk 
away. That's it, that's all. You've fulfilled your duties under the CVS 
"contract". 

If/when you come back, update your working directory (or check out a new 
copy) to get current with the version on the repository before you start 
editing, and you're "caught up to" whatever changes may have been made 
while you were away.

Something to keep in mind:
To paraphrase the old saying, "What happens in your working directory 
stays in your working directory - at least until you commit". Until you 
"commit", the CVS system (and the repository it's talking to, and 
therefore anyone else who might be accessing that repository) knows 
*NOTHING* about what you're doing in the "Las Vegas" of your working 
directory. Once you "talk about it" with a "commit", everything you've 
done to the codebase is public knowledge to everybody who has access to 
that repository, but the stuff you do in your working directory AFTER 
you "commit" remains invisible to the rest of the world - until the next 
time you "commit".

Which means that you COULD "checkout" exactly once, make so many changes 
that the original code isn't recognizable, never "commit", and still be 
good to go - at least in your working directory. The Repository codebase 
might go off in some other direction completely, but until/unless you 
update from the repository, or commit your changes, you can behave as if 
you're the only person working on the code. (Which is one of the major 
ideas that drove the creation of the CVS system to begin with...)

-- 
Email shown is deceased. If you would like to contact me by email, please
post something that makes it obvious in this or another group you see me
posting in with a "how to contact you" address, and I'll get back to you. 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]