You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Thufir <ha...@gmail.com> on 2008/01/14 11:04:18 UTC

svn add *

How can I use "svn add" to add the following in one go?

thufir@arrakis ~/hasmanythrough $ 
thufir@arrakis ~/hasmanythrough $ svn status
?      app/views/shared
?      app/views/layouts/streamlined.rhtml
?      vendor/plugins/streamlined
?      public/overlib
?      public/windows_js
?      public/images/streamlined
?      public/javascripts/rico_corner.js
?      public/javascripts/streamlined.js
?      public/stylesheets/as_style.css
?      public/stylesheets/menu.css
?      public/stylesheets/streamlined.css
thufir@arrakis ~/hasmanythrough $ 
thufir@arrakis ~/hasmanythrough $ 



thanks,

Thufir

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

Re: svn add *

Posted by marc gonzalez-carnicer <ca...@gmail.com>.
svn status does not have any filtering features yet (that'd be cool),
so you can try this not necessarily portable bash (dash) command

$ svn add $( svn status | grep "^?" | cut -c 8- )

in case you want to do a revert, or some other command that does not
accept more than 1 parameter, you can try :

$ for F in $( svn status | grep "^M" | cut -c 8- )
> do
> svn revert $F
> done

in case it does not work for your platform, i have the following
versions installed as provided by kubuntu 7.10

marcgc@lasercontroller $ bash --version
GNU bash, version 3.2.25(1)-release (i486-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
marcgc@lasercontroller $ cut --version
cut (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by David Ihnat, David MacKenzie, and Jim Meyering.
marcgc@lasercontroller $


2008/1/14, Ryan Schmidt <su...@ryandesign.com>:
> On Jan 14, 2008, at 05:04, Thufir wrote:
>
> > How can I use "svn add" to add the following in one go?
> >
> > thufir@arrakis ~/hasmanythrough $ svn status
> > ?      app/views/shared
> > ?      app/views/layouts/streamlined.rhtml
> > ?      vendor/plugins/streamlined
> > ?      public/overlib
> > ?      public/windows_js
> > ?      public/images/streamlined
> > ?      public/javascripts/rico_corner.js
> > ?      public/javascripts/streamlined.js
> > ?      public/stylesheets/as_style.css
> > ?      public/stylesheets/menu.css
> > ?      public/stylesheets/streamlined.css
> > thufir@arrakis ~/hasmanythrough $
>
> svn add app/views/shared app/views/layouts/streamlined.rhtml \
> vendor/plugins/streamlined public/overlib public/windows_js \
> public/images/streamlined public/javascripts/rico_corner.js \
> public/javascripts/streamlined.js public/stylesheets/as_style.css \
> public/stylesheets/menu.css public/stylesheets/streamlined.css
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

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

Re: svn add *

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 14, 2008, at 08:42, pobox@verysmall.org wrote:

> marc gonzalez-carnicer wrote:
>
>> $ svn status --filter-no-status-info 'MA' # don't display the status
>
> I am wondering, is there any special reason why subversion does not  
> have abbreviated commands.
>
> To type --filter-no-status-info every time is overkill. Or am I  
> missing something?

"--filter-no-status-info" was a hypothetical example. No such option  
actually exists in Subversion.

Most Subversion commands that actually exist do have abbreviated  
versions. See "svn help" or the Subversion Book at http://svnbook.org/

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

Re: svn add *

Posted by "pobox@verysmall.org" <po...@verysmall.org>.
marc gonzalez-carnicer wrote:
> $ svn status --filter-no-status-info 'MA' # don't display the status

I am wondering, is there any special reason why subversion does not have 
abbreviated commands.

To type --filter-no-status-info every time is overkill. Or am I missing 
something?

Iv

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

RE: Re: Re: svn add *

Posted by "Reedick, Andrew" <jr...@ATT.COM>.
> -----Original Message-----
> From: marc gonzalez-carnicer [mailto:carnicer.lists@gmail.com]
> Sent: Tuesday, January 15, 2008 11:54 AM
> To: Reedick, Andrew
> Cc: Subversion Users
> Subject: Re: Re: svn add *
> 
> 
> i know, although i am not an expert, about regex. my point is whether
> my proposed feature is useful or not, so that not everybody who wants
> to do wrapper scripts needs to rewrite it. actually, i've written
> several of
> these scripts.
> 
> i have checked the source code, and implementing my proposal is
> *much* easier than doing wrapper scripts with regex. see file
> subversion/svn/status.c, function print_status(). it's a matter
> of deciding whether the feature is useful or not. if it is, i could
> provide
> the patch myself.
> 

Well it couldn't hurt.  =)   

What about overloaded letter(s)?  Currently 'M' is used by both columns
1 and 2 in order to flag changes to the item itself or the item's
properties.
 

However, if you're going to go down that road, why not go all the way?
ClearCase has a souped up printf that was actually useful.  They gave %x
definitions to all of the information possible.  Example:
	svn status --fmt "status:  %M %m %L %n\n" 
where 
	%M is item was modified
	%m is item's properties were modified
	%L is lock status
	%n is the name of the item
	%N would be the full path to the item
	Ad nausem.

So the output would be:
	status:  Modified Unchanged Unlocked foo.java
Words instead of letters would be more user friendly.

In theory, you would add --fmt to all information type commands: info,
status, log, etc..  It would be exceptionally user friendly, but a bit
of an effort to implement.




*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA621


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


Re: Re: svn add *

Posted by marc gonzalez-carnicer <ca...@gmail.com>.
2008/1/14, Reedick, Andrew <jr...@att.com>:
> > -----Original Message-----

> _everything_ uses them: sed, Perl, Python, vi, etc..

i guess that statement may be controversial, specially on today's
world where windows in ubiquitous :) don't take me wrong, i am
a hardcore vim user, and i also do python and sed.


>
> You could what you propose below with about 30 minutes of playing with a
> regex tutorial.  Well worth the time invested, IMHO.

i know, although i am not an expert, about regex. my point is whether
my proposed feature is useful or not, so that not everybody who wants
to do wrapper scripts needs to rewrite it. actually, i've written several of
these scripts.

i have checked the source code, and implementing my proposal is
*much* easier than doing wrapper scripts with regex. see file
subversion/svn/status.c, function print_status(). it's a matter
of deciding whether the feature is useful or not. if it is, i could provide
the patch myself.

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

RE: Re: svn add *

Posted by "Reedick, Andrew" <jr...@ATT.COM>.
> -----Original Message-----
> From: marc gonzalez-carnicer [mailto:carnicer.lists@gmail.com]
> Sent: Monday, January 14, 2008 6:50 AM
> To: Ryan Schmidt
> Cc: Thufir; Subversion Users
> Subject: Re: svn add *
> 
> yeah, cool. whatever :) any of these hacks is hard to apply unless you
> are a bash freak and want to read the sed and/or cut manuals. and
> besides, these solutions are not complete, for example, it's hard to
> make them valid for server information, or for properties, etc.

Pffffft, if you can't handle the learning cliff^H^H^H^H^Hcurve...  But
seriously, it would be a good idea to learn 'regular expressions' (aka
regex.)  Google for a tutorial on regular expressions instead of trying
to read the man page.  Regexes are incredibly useful and pretty much
_everything_ uses them: sed, Perl, Python, vi, etc..

You could what you propose below with about 30 minutes of playing with a
regex tutorial.  Well worth the time invested, IMHO.

> 
> 2008/1/14, Ryan Schmidt <su...@ryandesign.com>:
> >
> > Or perhaps you were looking for:
> >
> > svn status | sed -n s/^\?//p | xargs svn add
> 
> 
> really, don't you think it'd be nice to have an svn status option /
> set of options that would allow to filter the svn status output.


Or you want a filter script that Someone(tm) could quickly write and add
to the contributed software section.  A script would probably be
available faster than a code change.

svn status | svn_filter.sh | xargs ....



*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA625


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


Re: svn add *

Posted by Miha Vitorovic <mv...@nil.si>.
> From my perspective, if "svn status" can generate the list, why cannot 
> "svn add" read that list?  Maybe even iterate through with a yes/no, or 
a 
> blanket "do you want to add all?" and then I can svn delete a few later.
> 
> Or, have "svn add_status" go through and and generate the list, and add 
> files, in one go.  After each item is found by "svn status" have "svn 
> add" add that file?

I'd guess that mainly because when designing any software, you have to 
decide whether you want to give people basic-yet-useful tool that they may 
combine into some specific way using scripting, or do you want to build 
the swiss army knife of source control with thousands of commands and 
options that nobody will ever be able to learn.

P.s. I do realize that this counts as needlessly extending a finished 
thread, so why don't I just mention Nazis and kill it. :)

Br, Miha Vitorovic

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

Re: svn add *

Posted by Thufir <ha...@gmail.com>.
On Mon, 14 Jan 2008 12:50:05 +0100, marc gonzalez-carnicer wrote:

> yeah, cool. whatever  any of these hacks is hard to apply unless you are
> a bash freak and want to read the sed and/or cut manuals.


Re: svn add *

Posted by marc gonzalez-carnicer <ca...@gmail.com>.
yeah, cool. whatever :) any of these hacks is hard to apply unless you
are a bash freak and want to read the sed and/or cut manuals. and
besides, these solutions are not complete, for example, it's hard to
make them valid for server information, or for properties, etc.

2008/1/14, Ryan Schmidt <su...@ryandesign.com>:
>
> Or perhaps you were looking for:
>
> svn status | sed -n s/^\?//p | xargs svn add


really, don't you think it'd be nice to have an svn status option /
set of options that would allow to filter the svn status output.

something like :

$ svn status --filter 'MA,U' #the comma separates WC from repo filter
M         a.txt
M         b.txt
A         c.txt
 U         d.txt

or any other syntax (defining it would not be trivial). anyhow, all
the clients have implemented the code to parse svn status output. but
the svn status program has the information, there's no need to parse
anything

$ svn status --filter-no-status-info 'MA' # don't display the status
a.txt
b.txt
c.txt

this would allow to use commands like :

$ svn revert $( svn status --filter-no-status-info 'MA' )

an useful command when an ill svn merge command is applied (wrong
revisions, etc). which would work even if properties have been
changed.

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

Re: svn add *

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 14, 2008, at 05:05, Ryan Schmidt wrote:

> On Jan 14, 2008, at 05:04, Thufir wrote:
>
>> How can I use "svn add" to add the following in one go?
>>
>> thufir@arrakis ~/hasmanythrough $ svn status
>> ?      app/views/shared
>> ?      app/views/layouts/streamlined.rhtml
>> ?      vendor/plugins/streamlined
>> ?      public/overlib
>> ?      public/windows_js
>> ?      public/images/streamlined
>> ?      public/javascripts/rico_corner.js
>> ?      public/javascripts/streamlined.js
>> ?      public/stylesheets/as_style.css
>> ?      public/stylesheets/menu.css
>> ?      public/stylesheets/streamlined.css
>> thufir@arrakis ~/hasmanythrough $
>
> svn add app/views/shared app/views/layouts/streamlined.rhtml \
> vendor/plugins/streamlined public/overlib public/windows_js \
> public/images/streamlined public/javascripts/rico_corner.js \
> public/javascripts/streamlined.js public/stylesheets/as_style.css \
> public/stylesheets/menu.css public/stylesheets/streamlined.css

Or perhaps you were looking for:

svn status | sed -n s/^\?//p | xargs svn add

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

Re: svn add *

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 14, 2008, at 05:04, Thufir wrote:

> How can I use "svn add" to add the following in one go?
>
> thufir@arrakis ~/hasmanythrough $ svn status
> ?      app/views/shared
> ?      app/views/layouts/streamlined.rhtml
> ?      vendor/plugins/streamlined
> ?      public/overlib
> ?      public/windows_js
> ?      public/images/streamlined
> ?      public/javascripts/rico_corner.js
> ?      public/javascripts/streamlined.js
> ?      public/stylesheets/as_style.css
> ?      public/stylesheets/menu.css
> ?      public/stylesheets/streamlined.css
> thufir@arrakis ~/hasmanythrough $

svn add app/views/shared app/views/layouts/streamlined.rhtml \
vendor/plugins/streamlined public/overlib public/windows_js \
public/images/streamlined public/javascripts/rico_corner.js \
public/javascripts/streamlined.js public/stylesheets/as_style.css \
public/stylesheets/menu.css public/stylesheets/streamlined.css

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