You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Eric Gorr <ma...@ericgorr.net> on 2005/06/10 16:40:09 UTC

Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Proniewski Patrick wrote:
> Hello
> 
> On 10 juin 05, at 10:59, Mathieu Betrancourt wrote:
> 
>> If you add, or delete contents in the document (like pictures), the
>> application will add, or remove files into the bundle.
>>
>> Is there a (simple) way to make svn follow every changes in a folder ?
> 
> 
> Damn, I haven't seen this one coming. As i see it, you might want to  
> create a wrapper (shell script for example) for svn command, that  would 
> check for bundles, and automagically `svn add` or `svn delete`  files 
> before commit.

Well, it would seem useful for the svn client application to handle this 
itself at some point in the future. Perhaps a property stored with the 
folder containing versioned resources. The property would basically tell 
the svn client that it should check to see if there are any files in the 
folder (or it's subfolders) which aren't versioned and to automatically 
add them if any are found. Of course, one should be allowed to exclude 
files or subfolders based on regular expression patterns from this check.

I have a feeling, considering that Bundles are such a good idea, that 
other OSs will adopt them for documents as well. (Windows has them for 
applications...I suspect bundled documents on Windows will come with 
Longhorn.)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Chia-liang Kao <cl...@clkao.org>.
Christopher Ness <chris <at> nesser.org> writes:
> I think this is something you would see in SVK or some of the other user
> interfaces.  I know SVK is attempting merge tracking and some other
> features that are above and beyond the scope of SVN currently.

Following up the original topic, in fact there's svk commit --import which
adds and removes files automagically for you in your checkout copy.

Cheers,
CLK



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Christopher Ness <ch...@nesser.org>.
On Fri, 2005-06-10 at 15:12 -0400, Eric Gorr wrote:
> Christopher Ness wrote:
> > I hate to say it but most SVN commands that I know do not attempt to do
> > "auto-magic" things for users.  You need to tell subversion exactly what
> > you want to do.
> 
> On this point, I would agree and retract the earlier suggestion.
> 
> Perhaps then it should be either an explicit command (svn 
> addunversioned) or a flag on svn add.

I think this is something you would see in SVK or some of the other user
interfaces.  I know SVK is attempting merge tracking and some other
features that are above and beyond the scope of SVN currently.

I don't know how to decide what belongs in the command line client and
what should go to a higher level like tsvn or the others.  Things are
blurry in my mind - and that's why I'm not in charge.  

Hopefully you guys can draw a squiggly line in the sand on the devel
list.

Cheers,
Chris
-- 
Wireless Group,
McMaster University

finger.localdomain
18:21:52 up 1:04, 1 user, load average: 0.00, 0.05, 0.12


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Eric Gorr <ma...@ericgorr.net>.
Scott Palmer wrote:
  >> If we did decide to go ahead with some kind of --exclude, it would
>> make more sense to do it generally, and make it available to  *every* 
>> recursive command, not just this one.
> 
> 
> Agreed.

Well, --exclude would be extremely useful for the svn import command 
alone which, by definition, does not know about svn:ignore....it does 
know about global-ignores, but it seems silly to require one to 
temporarily change the global-ignores for this one case.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Scott Palmer <sc...@2connected.org>.
On Jun 10, 2005, at 6:05 PM, Max Bowsher wrote:

> Scott Palmer wrote:
>>
>>> Doesn't svn:ignore fulfil this purpose already?
>>>
>>
>> Not really.  Since  svn:ignore is a property set on the versioned
>> folder it could easily not include things that shouldn't be versioned
>> but aren't cumbersome enough that any specific user cared that they
>> showed up in the status command.  Also there is no control of what
>> files someone might put in their WC, so the global (all users) nature
>> of svn:ignore can't possibly know enough for the specific WC that the
>> command is executed on.  E.g. users might have little scripts that
>> are specific to their WC.
>>
>
> Then they can sort out some standard naming pattern in order apply  
> svn:ignore to them.
> Would they really want to remember to type --exclude foo *every* time?

For all I know that's what is in one of those scripts ;-)

Seriously, I rarely have svn:ignore set up to ignore everything that  
it possibly could.  I often have experimental files or data files of  
some sort in my WC that I don't want to ignore, and I don't want to  
add.  These are test files that are specific to my working environment.

> If we did decide to go ahead with some kind of --exclude, it would  
> make more sense to do it generally, and make it available to  
> *every* recursive command, not just this one.

Agreed.

Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Max Bowsher <ma...@ukf.net>.
Scott Palmer wrote:
> On Jun 10, 2005, at 4:18 PM, Max Bowsher wrote:
>
>> Eric Gorr wrote:
>>
>>> Perhaps then it should be either an explicit command (svn
>>> addunversioned) or a flag on svn add.
>>
>> A new command, because it should be a combination of delete and add.
>
> Why not a flag or two to the existing 'svn add'  and 'svn delete'?
>
> E.g.
> svn add --unversioned
> svn delete --missing

That UI works ok too, I guess... but it's 2 commands, when very often you 
will want both behaviours simultaneously.

>>> and take --exclude patterns (see rsync for a good
>>> implementation of exclude patterns) so the user can avoid having
>>> files versioned that still should not be.
>>
>> Hmm. Really needed?
>
> It would help
>
>> Doesn't svn:ignore fulfil this purpose already?
>
> Not really.  Since  svn:ignore is a property set on the versioned
> folder it could easily not include things that shouldn't be versioned
> but aren't cumbersome enough that any specific user cared that they
> showed up in the status command.  Also there is no control of what
> files someone might put in their WC, so the global (all users) nature
> of svn:ignore can't possibly know enough for the specific WC that the
> command is executed on.  E.g. users might have little scripts that
> are specific to their WC.

Then they can sort out some standard naming pattern in order apply 
svn:ignore to them.
Would they really want to remember to type --exclude foo *every* time?

If we did decide to go ahead with some kind of --exclude, it would make more 
sense to do it generally, and make it available to *every* recursive 
command, not just this one.

Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Max Bowsher <ma...@ukf.net>.
Eric Gorr wrote:
> Scott Palmer wrote:
>> 
>> On Jun 10, 2005, at 4:18 PM, Max Bowsher wrote:
>> 
>>> Eric Gorr wrote:
>>> 
>>>> Perhaps then it should be either an explicit command (svn
>>>> addunversioned) or a flag on svn add.
>>> 
>>> 
>>> A new command, because it should be a combination of delete and add.
>> 
>> 
>> Why not a flag or two to the existing 'svn add'  and 'svn delete'?
>> 
>> E.g.
>> svn add --unversioned
> 
> Doesn't svn add already do this by definition?

Good point, "svn add --force ." already has this effect.

Not the most intuitive of interfaces, but it does work.


Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Eric Gorr <ma...@ericgorr.net>.
Scott Palmer wrote:
> 
> On Jun 10, 2005, at 6:11 PM, Eric Gorr wrote:
> 
>> Scott Palmer wrote:
>>
>>> Why not a flag or two to the existing 'svn add'  and 'svn delete'?
>>> E.g.
>>> svn add --unversioned
>>
>>
>> Doesn't svn add already do this by definition?
> 
> 
> 
> Probably, I didn't check :)  (I never use it that way.)

Neither did I until I started posting...sigh.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Scott Palmer <sc...@2connected.org>.
On Jun 10, 2005, at 6:11 PM, Eric Gorr wrote:

> Scott Palmer wrote:
>> Why not a flag or two to the existing 'svn add'  and 'svn delete'?
>> E.g.
>> svn add --unversioned
>
> Doesn't svn add already do this by definition?


Probably, I didn't check :)  (I never use it that way.)

Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Eric Gorr <ma...@ericgorr.net>.
Scott Palmer wrote:
> 
> On Jun 10, 2005, at 4:18 PM, Max Bowsher wrote:
> 
>> Eric Gorr wrote:
>>
>>> Perhaps then it should be either an explicit command (svn
>>> addunversioned) or a flag on svn add.
>>
>>
>> A new command, because it should be a combination of delete and add.
> 
> 
> Why not a flag or two to the existing 'svn add'  and 'svn delete'?
> 
> E.g.
> svn add --unversioned

Doesn't svn add already do this by definition?





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Scott Palmer <sc...@2connected.org>.
On Jun 10, 2005, at 4:18 PM, Max Bowsher wrote:

> Eric Gorr wrote:
>
>> Perhaps then it should be either an explicit command (svn
>> addunversioned) or a flag on svn add.
>
> A new command, because it should be a combination of delete and add.

Why not a flag or two to the existing 'svn add'  and 'svn delete'?

E.g.
svn add --unversioned
svn delete --missing


>> and take --exclude patterns (see rsync for a good
>> implementation of exclude patterns) so the user can avoid having  
>> files
>> versioned that still should not be.
>
> Hmm. Really needed?


It would help

> Doesn't svn:ignore fulfil this purpose already?

Not really.  Since  svn:ignore is a property set on the versioned  
folder it could easily not include things that shouldn't be versioned  
but aren't cumbersome enough that any specific user cared that they  
showed up in the status command.  Also there is no control of what  
files someone might put in their WC, so the global (all users) nature  
of svn:ignore can't possibly know enough for the specific WC that the  
command is executed on.  E.g. users might have little scripts that  
are specific to their WC.

Scott

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Max Bowsher <ma...@ukf.net>.
Eric Gorr wrote:
> Christopher Ness wrote:
>
>> To remove files that went away and are identified by a '!', use:
>>            svn status | grep ^\! | cut -c8- | xargs svn rm
>
>> To add files svn doesn't know about:
>>            svn status | grep ^\? | cut -c8- | xargs svn add
>
>> Good luck convincing the Devel's. ;)
>
> Well, considering that it is possible I could become one, it wouldn't be
> that hard to convince me. :-)

Actually, I've scripted things like the above commands enough times, that 
I'm actually in favour of an "auto add new things, auto rm deleted things" 
command.

...

> Perhaps then it should be either an explicit command (svn
> addunversioned) or a flag on svn add.

A new command, because it should be a combination of delete and add.

> The svn addunversioned would take a source directory in which to look
> for files.

And would default to acting on '.', as most current commands do.

> It would have a -r flag to recursively search through
> subdirectories

Recursive by default seems more sensible and consistent to me.

> and take --exclude patterns (see rsync for a good
> implementation of exclude patterns) so the user can avoid having files
> versioned that still should not be.

Hmm. Really needed?
Doesn't svn:ignore fulfil this purpose already?


Anyway, we should take this to the dev@ list, since we've started a design 
discussion.
Want to summarize and start a thread there?

Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Eric Gorr <ma...@ericgorr.net>.
Christopher Ness wrote:

 > To remove files that went away and are identified by a '!', use:
 >            svn status | grep ^\! | cut -c8- | xargs svn rm

 > To add files svn doesn't know about:
 >            svn status | grep ^\? | cut -c8- | xargs svn add

> Good luck convincing the Devel's. ;) 

Well, considering that it is possible I could become one, it wouldn't be 
that hard to convince me. :-)

> They don't like to add bloat for
> things that can be simply [though that is a relative term] done outside
> the program and I agree with that stance.

Considering that it is useful and I believe will be increasingly 
required by even average users, the method for accomplishing this task 
should be easily discernible by the user who does not wish to know much 
about pipes, scripting, etc. It is simply good user interface design and 
certainly not bloat to provide the user with an easily discoverable 
method for accomplishing this task.

The method you pointed out certainly works, but fails every good user 
interface design test I am aware of.

> I hate to say it but most SVN commands that I know do not attempt to do
> "auto-magic" things for users.  You need to tell subversion exactly what
> you want to do.

On this point, I would agree and retract the earlier suggestion.

Perhaps then it should be either an explicit command (svn 
addunversioned) or a flag on svn add.

The svn addunversioned would take a source directory in which to look 
for files. It would have a -r flag to recursively search through 
subdirectories and take --exclude patterns (see rsync for a good 
implementation of exclude patterns) so the user can avoid having files 
versioned that still should not be.

This would pass the test of telling subversion exactly what you want to do.

-- 
== Eric Gorr =============================== http://www.ericgorr.net ===
"Government is not reason, it is not eloquence, it is force; like fire,
a troublesome servant and a fearful master." - George Washington
== Insults, like violence, are the last refuge of the incompetent... ===

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Automatically adding new files in a folder (Re: versioning MacOS X bundle)

Posted by Christopher Ness <ch...@nesser.org>.
On Fri, 2005-06-10 at 12:40 -0400, Eric Gorr wrote:
> Proniewski Patrick wrote:
> > On 10 juin 05, at 10:59, Mathieu Betrancourt wrote:
> > 
> >> If you add, or delete contents in the document (like pictures), the
> >> application will add, or remove files into the bundle.
> >>
> >> Is there a (simple) way to make svn follow every changes in a folder ?
> > 
> > 
> > Damn, I haven't seen this one coming. As i see it, you might want to  
> > create a wrapper (shell script for example) for svn command, that  would 
> > check for bundles, and automagically `svn add` or `svn delete`  files 
> > before commit.

I agree and had to do this myself after applying some ARM patches to a
kernel.  Files were removed and added so I needed to tell subversion
what to do.  A simple one liner to do just this is like so...

To remove files that went away and are identified by a '!', use:
           svn status | grep ^\! | cut -c8- | xargs svn rm

To add files svn doesn't know about:
           svn status | grep ^\? | cut -c8- | xargs svn add

> Well, it would seem useful for the svn client application to handle this 
> itself at some point in the future. Perhaps a property stored with the 
> folder containing versioned resources. The property would basically tell 
> the svn client that it should check to see if there are any files in the 
> folder (or it's subfolders) which aren't versioned and to automatically 
> add them if any are found. Of course, one should be allowed to exclude 
> files or subfolders based on regular expression patterns from this check.
> 
> I have a feeling, considering that Bundles are such a good idea, that 
> other OSs will adopt them for documents as well. (Windows has them for 
> applications...I suspect bundled documents on Windows will come with 
> Longhorn.)

Good luck convincing the Devel's. ;)  They don't like to add bloat for
things that can be simply [though that is a relative term] done outside
the program and I agree with that stance.

I hate to say it but most SVN commands that I know do not attempt to do
"auto-magic" things for users.  You need to tell subversion exactly what
you want to do.

It isn't too hard to be explicit - see above.  You should be able to
write similar scripts in other OS' other than GNU/Linux.

Cheers,
Chris
-- 
Wireless Group,
McMaster University

finger.localdomain
13:47:42 up 3:28, 1 user, load average: 0.00, 0.05, 0.03


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org