[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: how to tell what I need to 'svn add' ?

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2002-05-01 20:57:13 CEST

Alexis Huxley <ahuxley@gmx.net> writes:

> In the SVN user manual it says that sources are registered with the
> working copy by using 'svn add'. Fine, but do people (i) immediately
> 'svn add' stuff as they create it - even though 30 seconds later
> they might realise the file they created was a bad idea, or (ii) 'svn
> add' stuff once the stuff has been around long enough for the person to
> be sure creating the file was more than just a passing fancy or (iii)
> just before 'svn commit' or (iv) at some other 'mental event'? :-)

'svn add' simply schedules a file for addition to the repository;
it's not actually sent until you 'svn commit'.

Therefore, it doesn't matter when you schedule the addition. You can
do it at any of the times you suggest. If you change your mind, you
can *un*-schedule the addition by doing either 'svn revert foo.c' or
'svn rm foo.c'.

As Nathan said, 'svn status' will show you local modifications, and
print '?' next to unversioned things in your working copy -- thus
serving as a reminder that things might need to be added.

> 'svn diff' appears to show the difference between the pristene tree
> and the current tree *excluding* what has not yet been 'svn add'ed
> (I tried touching a new file and then 'svn diff' and no differences
> were shown).

That's true. 'svn diff' shows local modifications to your working
copy. A scheduled addition is a type of local modification. That's
why it's probably easier to just 'svn add' files right when you create
them -- you'll see them in the diffs. You can always un-schedule the
addition later if you want.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 1 21:00:40 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.