I only use CVS when I'm interfacing with drupal.org and I'm sure other people are in the same boat as me. I always have to look up the CVS commands because I can't remember them. For that reason I've gone through the CVS section of the handbook and copied out the most common commands. My idea was to post this as a one-page cheat sheet in the CVS section.

All the infomation is already there, but I feel it would be useful to have only the commands collected on one page. This would be for people who have used CVS before, but just can't remember the syntax.

However, since I'm only a casual user I would like to request a tech. review from a regular CVS user to make sure all the commands below are correct before I post it in the handbook.

I will of course format this with better spacing when I post it in the handbook.

==== Start cheat sheet ====

*** The drupal project and module development.

Create a patch in unified format (one file)
cvs diff -up original.php > filename.patch
Create a patch in unified format (multiple files)
cvs diff -uRp modules/mymodule > filename.patch
Do a dry-run of a patch
patch -p0 < the_patch_file.patch --dry-run
Apply a patch
patch -p0 < path/file.patch
Send a diff to textmate
cvs diff -up original.php | mate
Make a diff against the server
cvs diff -up original.php
Checkout Drupal HEAD to current directory
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout drupal
Checkout Drupal HEAD to mywebsites/drupal_head
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -d mywebsites/drupal_head/ drupal
Checkout Drupal 5.7 to current dir
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -r DRUPAL-5-7 drupal
Update local repository
cvs update -dP
Examine which files have changes
cvs status
cvs status filename.txt
Discard local changes to a file and update from server
cvs up -C file.module

*** Module development.

Checkout a specific module (HEAD)
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d modulenamehere contributions/modules/modulenamehere
Checkout a specific branch of a specific module
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-5--1-0 -d moduleName contributions/modules/moduleName
Commit changes to repos
cvs commit -m "Initial commit of example module. Here is a brief description of what this module does."
Create new branch (drupal core compatibility)

cvs update -r DRUPAL-6--1
  cvs tag -b DRUPAL-6--2

Create new tag (regular release)
cvs tag DRUPAL-6--1-1

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

add1sun’s picture

We should look how this matches up with other efforts in the same vein and *make sure these things are easy to find*. There was a GHOP task for this (http://drupal.org/node/203430) and I know that Derek made one that was handed out at Drupalcon and should be posted in here somwhere. I don't have time to look around right now but maybe others will pipe up.

add1sun’s picture

andreashaugstrup’s picture

I just saw Derek's link to his handout from drupalcon on the dev. mailing list and came here to post the link. I was way too slow!

PDF sheets are nice to print out, but they don't fill the gap I was trying to fill with my list of commands. I am looking for something I can have bookmarked and then use to copy/paste from when I'm working with CVS. I can't do that with a PDF.

So the GHOP sheet doesn't really fill the gap either. I don't need a list of flags I can set on CVS commands: I just need the 8 commands that I need to use when I'm rolling patches and reverting.

All the information I listed above (with the exception of "cvs up -C") is already in the CVS handbook (which is a very good handbook imho), but I can never remember which of the 5 pages contain the command I'm looking for.

That's why I feel this would be helpful to have these commands collected on a single handbook page in addition to where the information is stored now.

cyberswat’s picture

The information on this page helps me as it is very distinctly expressed in a fashion I can use rapidly. I have this page bookmarked and reference it frequently. The information presented in the other cheat sheets is lovely .. but I find the presentation of the information in this post of significantly more real world to me personally as I develop. The value of having a simple page that lists each of these examples in a way that I can quickly copy paste and modify to suit my needs is better for my uses than the cheat sheets at http://drupal.org/node/203430 or any of the child pages at http://drupal.org/handbook/cvs

I think it would be of great value to add this content to the handbook.

nielsbom’s picture

Component: Developer Guide » New documentation

Changed the component to reflect the new component categorization. See http://drupal.org/node/301443
-nielsbom

add1sun’s picture

Yeah, I agree that a simple cheat sheet list like this is nice. I'm not sure where it should go since this covers several different aspects that are split in different places in the handbook (and patch is not technically cvs). Suggestions?

ipwa’s picture

One suggestion I just though of, is to make a new section in the handbook for cheatsheets. We could have a list of all the cheatsheets with links so users can download them in PDF format. Here are some links to cheatsheets I've found:

- FormAPI
- Theme developer
- Hooks
- Older CVS cheat sheet
- Gabor's Drupal 6 translation cheat sheet
- Theme flow D5
- Theme flow D6

*update: - Drupal 6 API Cheatsheet

add1sun’s picture

Yeah, agreed that would be handy. instead of making a page for that, I think I'd rather wait until the redesign and let tagging and views build those kinds of lists for us. That will mean one fewer page that needs to be manually tracked and updated.

Todd Nienkerk’s picture

I've attached a PDF version of a Four Kitchens wiki page. This is the cheat sheet we use internally. It's not entirely complete, as it doesn't discuss how to create project pages on Drupal.org.

I don't mean to dogpile the task. If this can be useful, hooray! If not, I'll wait until the redesign to get into specifics regarding CVS documentation. (This is a subject close to my heart!)

cyberswat’s picture

Status: Active » Fixed

I think this has pretty much been resolved ... at least for modules. I just noticed the "CVS Instructions" tab on my modules pages which is everything that I would reference this issue for ... that tab exceeds my expectations for placing this information in a usable location with relevant information. I'm going to tentatively mark this as fixed.

@add1sun What are the chances of getting a similar tab on http://drupal.org/project/drupal ... is there a better issue in existence people should direct their focus towards? Thanks for the great work!

[edit] I'm using #396186: Add to Drupal project page under the Project CVS instructions module page for this.

add1sun’s picture

@cyberswat, I'm not involved at all with the new project tab (and didn't even know of its existence until this popped up in email) so I can't really speak to it at all. Thankfully much is happening in docs that I don't actually have my hands in. :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.