Announcing RemoveSVN

  • Hi all,

    Today I finally decided I had had enough with pesky .svn folders
    lurking around source that I wanted to upload to the web (those .svn
    folders really take a while to upload!) so I decided to do something
    about the problem.  I made a simple little utility based on
    NSFileManager that eradicates them recursively in whichever folder you
    choose.  Right now it's Leopard-only and its look could be improved,
    but what matters is it works.  I'm making it available for download at http://www.lclark.edu/~stigler/RemoveSVN.zip
      .  I hope it saves you as much time as it saved me today.

    I'm sorry if this is off-topic; I just figured people would be
    interested to know about this.

    -Sam
  • On Nov 5, 2007, at 3:29 AM, Sam Stigler wrote:

    > Today I finally decided I had had enough with pesky .svn folders
    > lurking around source that I wanted to upload to the web
    > (those .svn folders really take a while to upload!) so I decided to
    > do something about the problem.  I made a simple little utility
    > based on NSFileManager that eradicates them recursively in
    > whichever folder you choose.  Right now it's Leopard-only

    You can do the same thing with a simple shell command, which works
    not only in any version of Mac OS X, but in any other *nix as well:

    find /path/to/folder -name '.svn' | xargs rm -r

    sherm--

    Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    Cocoa programming in Perl: http://camelbones.sourceforge.net
  • Thanks... I've also been advised that "svn export" will perform a
    similar function.

    Thanks also for pointing me to xargs; that looks interesting.

    -Sam

    On Nov 5, 2007, at 1:15 AM, Sherm Pendley wrote:

    > On Nov 5, 2007, at 3:29 AM, Sam Stigler wrote:
    >
    >> Today I finally decided I had had enough with pesky .svn folders
    >> lurking around source that I wanted to upload to the web
    >> (those .svn folders really take a while to upload!) so I decided to
    >> do something about the problem.  I made a simple little utility
    >> based on NSFileManager that eradicates them recursively in
    >> whichever folder you choose.  Right now it's Leopard-only
    >
    > You can do the same thing with a simple shell command, which works
    > not only in any version of Mac OS X, but in any other *nix as well:
    >
    > find /path/to/folder -name '.svn' | xargs rm -r
    >
    > sherm--
    >
    > Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    > Cocoa programming in Perl: http://camelbones.sourceforge.net
    >
    >
  • Once upon a time Sherm Pendley wrote:
    > You can do the same thing with a simple shell command, which works
    > not only in any version of Mac OS X, but in any other *nix as well:
    >
    > find /path/to/folder -name '.svn' | xargs rm -r

    Or more correct:
    find /path/to/folder -name '*.svn' -type f -exec rm -r {} \;

    /J

    --
                                \|I|||/
                                ( o o )
    ------------------------oOOO--(_)--OOOo----------------------
    Johan Claesson <Johan...>      ICQ UIN #: 120774834
  • Le 07-11-05 à 20:51, Johan Claesson a écrit :

    >
    > Once upon a time Sherm Pendley wrote:
    >> You can do the same thing with a simple shell command, which works
    >> not only in any version of Mac OS X, but in any other *nix as well:
    >>
    >> find /path/to/folder -name '.svn' | xargs rm -r
    >
    > Or more correct:
    > find /path/to/folder -name '*.svn' -type f -exec rm -r {} \;
    >

    Or even more correct:

    find /path/to/folder -name '*.svn' -type d -exec rm -r {} \;

    Sandy.
  • On Nov 5, 2007, at 4:51 AM, Johan Claesson wrote:

    >
    > Once upon a time Sherm Pendley wrote:
    >> You can do the same thing with a simple shell command, which works
    >> not only in any version of Mac OS X, but in any other *nix as well:
    >>
    >> find /path/to/folder -name '.svn' | xargs rm -r
    >
    > Or more correct:
    > find /path/to/folder -name '*.svn' -type f -exec rm -r {} \;

    TIMTOWTDI.

    It's difficult to make a case for "more correct" when both work
    (except yours wouldn't, since it wouldn't remove anything unless you
    had plain files with that name).

    In general, xargs is more efficient anyway. With the -exec option
    passed to find, you're performing the command you're passing to exec
    anew with each result that find turns up. When you use xargs, you're
    building up the argument list using find, passing it en masse to
    xargs, which then passes the list en masse to whatever you're doing
    with the argument list, in this case 'rm'.

    --
    Chris Woods
    <chris...>
    gmail/gtalk: <chris.woods...>
  • Once upon a time Chris Woods wrote:
    > On Nov 5, 2007, at 4:51 AM, Johan Claesson wrote:
    >
    >>
    >> Once upon a time Sherm Pendley wrote:
    >>> You can do the same thing with a simple shell command, which works
    >>> not only in any version of Mac OS X, but in any other *nix as well:
    >>>
    >>> find /path/to/folder -name '.svn' | xargs rm -r
    >>
    >> Or more correct:
    >> find /path/to/folder -name '*.svn' -type f -exec rm -r {} \;
    >
    > TIMTOWTDI.
    >
    > It's difficult to make a case for "more correct" when both work
    > (except yours wouldn't, since it wouldn't remove anything unless you
    > had plain files with that name).
    >
    > In general, xargs is more efficient anyway. With the -exec option
    > passed to find, you're performing the command you're passing to exec
    > anew with each result that find turns up. When you use xargs, you're
    > building up the argument list using find, passing it en masse to
    > xargs, which then passes the list en masse to whatever you're doing
    > with the argument list, in this case 'rm'.

    This is rather OT, but xargs won't work if you have file or directory
    names with spaces in them.

    Use: find /path/to/folder -name '.svn' -type d -exec rm -r {} \;

    /J

    PS. There are more dangerous aspects of using xargs BTW... DS.
  • On 11/5/07, Johan Claesson <Johan...> wrote:
    > Once upon a time Chris Woods wrote:
    >>
    >> In general, xargs is more efficient anyway. With the -exec option
    >> passed to find, you're performing the command you're passing to exec
    >> anew with each result that find turns up. When you use xargs, you're
    >> building up the argument list using find, passing it en masse to
    >> xargs, which then passes the list en masse to whatever you're doing
    >> with the argument list, in this case 'rm'.
    >
    > This is rather OT, but xargs won't work if you have file or directory
    > names with spaces in them.

    It will if you pass -print0 to find, and pass -0 to xargs:

        find /path/to/folder -name '.svn' -print0 | xargs -0 rm -r

    Dave.
  • On Nov 5, 2007, at 6:59 AM, Johan Claesson wrote:

    > Once upon a time Chris Woods wrote:
    >> On Nov 5, 2007, at 4:51 AM, Johan Claesson wrote:
    >>
    >>> Once upon a time Sherm Pendley wrote:
    >>>> You can do the same thing with a simple shell command, which works
    >>>> not only in any version of Mac OS X, but in any other *nix as well:
    >>>>
    >>>> find /path/to/folder -name '.svn' | xargs rm -r
    >>>
    >>> Or more correct:
    >>> find /path/to/folder -name '*.svn' -type f -exec rm -r {} \;
    >>
    >> TIMTOWTDI.
    >>
    >> It's difficult to make a case for "more correct" when both work
    >> (except yours wouldn't, since it wouldn't remove anything unless you
    >> had plain files with that name).
    >>
    >> In general, xargs is more efficient anyway. With the -exec option
    >> passed to find, you're performing the command you're passing to exec
    >> anew with each result that find turns up. When you use xargs, you're
    >> building up the argument list using find, passing it en masse to
    >> xargs, which then passes the list en masse to whatever you're doing
    >> with the argument list, in this case 'rm'.
    >
    > This is rather OT, but xargs won't work if you have file or directory
    > names with spaces in them.

    Really?

    find /path/to/folder -name '.svn' -print0 | xargs -0 rm -r

    sherm--

    Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    Cocoa programming in Perl: http://camelbones.sourceforge.net
  • On 05/11/2007, Johan Claesson <Johan...> wrote:

    > This is rather OT, but xargs won't work if you have file or directory
    > names with spaces in them.

    Generally yes, but where exactly is the space character in '.svn'?

    Igor :-/
  • At 2:35 PM +0000 11/5/07, Igor Mozolevsky wrote:
    > On 05/11/2007, Johan Claesson <Johan...>  wrote:
    >
    >> This is rather OT, but xargs won't work if you have file or directory
    >> names with spaces in them.
    >
    > Generally yes, but where exactly is the space character in '.svn'?

    As soon as Apple-land wakes up, you're going to hear that this thread
    started somewhat off-topic, and has gone further and further afield.

    FYI,
    Dan

    --
    Daniel T. Griscom            <griscom...>
    Suitable Systems              http://www.suitable.com/
    1 Centre Street, Suite 204    (781) 665-0053
    Wakefield, MA  01880-2400
  • Dan is absolutely correct.

    Please, please stay on topic.

    Off-topic posts have become rampant since the release of Leopard.

    Ultimately, there are really only three solutions:

    1. start posting more of these warnings (which I'm loath to do)
    3. send warning emails off list (which I have been doing)
    2. start moderating users initiating off-topic posts, as well as those
    who continually take part in them.

    Scott
    Moderator

    On Nov 5, 2007, at 9:42 AM, Daniel Griscom wrote:

    > At 2:35 PM +0000 11/5/07, Igor Mozolevsky wrote:
    >> On 05/11/2007, Johan Claesson <Johan...> wrote:
    >>
    >>> This is rather OT, but xargs won't work if you have file or
    >>> directory
    >>> names with spaces in them.
    >>
    >> Generally yes, but where exactly is the space character in '.svn'?
    >
    > As soon as Apple-land wakes up, you're going to hear that this
    > thread started somewhat off-topic, and has gone further and further
    > afield.
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today