[vox-tech] subversion: print non-versioned files in directory

Matt Roper matt at mattrope.com
Thu Dec 15 10:19:23 PST 2005


On Thu, Dec 15, 2005 at 12:50:01PM -0500, Peter Jay Salzman wrote:
> 
> hi all,
> 
> i've been using subversion for a little while now, and everytime i do, i
> thank my lucky stars.  it completely blows away cvs in every way.
> 
> one thing i'm not seeing is how to get svn to print out files that are not
> under version control.
> 
> for example, suppose you do a global "cvs commit" and there's a file named
> 'foo' in the directory but it isn't in the cvs repository.  cvs will print:
> 
>    satan$ cvs commit
>    ? foo
>    satan$
> 
> however, svn is silent about such files.  i almost always do NOT want to see
> files like foo, but sometimes i DO want to see which files are present but
> not in subversion's repository.
> 
>    satan$ svn commit
>    satan$
> 
> is there a way to print such files in subversion?
> 
> thx,
> pete

Hi Pete.  I think what you're looking for is the 'svn status' command.
In addition to showing you any files that have been modified locally,
any files that are not present in the repository will be indicated by a
question mark.  For example:

    $ svn status
    M      file1
    M      file2
    ?      file3
    ?      file4

shows that file1 and file2 are in the repository but have local
modifications while file3 and file4 are not in the repository yet.

Since it's quite common to have a bunch of "junk" files sitting in your
directory that you don't care about (e.g., .o, .c~, etc.), subversion
allows you to set a property on a directory that tells it names/patterns
of files to ignore.  You can do this by running 

    svn propedit svn:ignore .
    
This should load up $EDITOR to allow you to edit the property list
(which will be empty the first time you do this); just enter a list of
filenames (wildcards okay) that you want ignored by subversion (one
filename per line), and they will no longer appear in the output of the
'svn status' command.  After entering the filenames and then saving and
closing the editor, run the 'svn status' command again and the names you
entered should be omitted.

One minor note with the "svn propedit" command:  I always do an "svn
commit" followed by an "svn update" immediately before and after using
the propedit command.  Subversion can get confused if you wind up trying
to commit changes to files and to directory properties at the same time
-- it's best to make sure that you commit property changes separately
from anything else you're doing.

Hope that helps.


Matt

-- 

*************************************************
* Matt Roper <matt at mattrope.com>                *
* http://www.mattrope.com                       *
* PGP Key: http://www.mattrope.com/mattrope.asc *
*************************************************


More information about the vox-tech mailing list