How to set SVN global ignores

There are some customizations that I make that pertains to my development computer only and because I work in a team environment I cannot commit in things that are customized towards my development environment. In order to do this, I do a global ignore on the file. Here’s how to do a global ignore. The subversion config file for Ubuntu 12.04 LTS or 12.10 is here:

[code language=”bash”]sudo nano /etc/subversion/config[/code]

There is a section that looks like this

[code language=”bash”][miscellany]

Set global-ignores to a set of whitespace-delimited globs

which Subversion will ignore in its ‘status’ output, and

while importing or adding files and directories.

‘ matches leading dots, e.g. ‘.rej’ matches ‘.foo.rej’.

global-ignores = .o *.lo *.la *.al .libs *.so *.so.[0-9] *.a *.pyc *.pyo

.rej *~ ## .#* .*.swp .DS_Store[/code]

You can uncomment that “global-ignores” part.

One more example why SVN sucked

The worst part of SVN is that it’s got lots of .svn folders hidden in every single versioned directory. It has never occurred to me how terrible an idea this is until I delete a directory. I had this weird deja vu that I’m going to regret issuing that rm -rf command but I did so anyway. It’s versioned, I tell myself.

Ah, but there’s a catch

No. Once I did that I spend the next 30 minutes trying several commands to recover it, such as svn revert and svn update. They don’t work because the current directory’s .svn folder is still there and it’s just silly SVN’s way of knowing its there. Every command to revert led me, falsely, to believe my folders are all still there.

So I downloaded an entire new copy of the files I just deleted and put them back. That failed as the files I have restored manually don’t have the .svn folders. I tried committing the restored copies and the SVN server will just say the “Commit failed” with the reason “Server sent unexpected return value (405 Method Not Allowed) in response to MKCOL request for ‘…'”.

Don’t tell me what I can’t do!

Well… The thing is I wasn’t convinced. In an act of folly I deleted the parent directory which now resulted in the whole project just dead basically. Fantastic.

I should add that at this moment it all came back to me. I am certain this SHITuation happens to me at least a dozen time especially when I’m half awake.

As least Git doesn’t have that issue. Every time I use SVN, I have this feeling I’m walking on thin rope fearing to offend the Tiki gods. I guess I’m just not smart enough for SVN.

Locked by an invisible lock

This is not funny at all… 不好笑… 肯本都不好笑…

[code lang=”dos”]C:projectsXXX>svn update
svn: Working copy ‘cake’ locked
svn: run ‘svn cleanup’ to remove locks (type ‘svn help cleanup’ for details)

C:projectsXXX>svn cleanup
svn: Unable to lock ‘cakescriptstemplatesskelplugins’

C:projectsXXX>svn commit
svn: Working copy ‘C:projectsXXX’ locked
svn: run ‘svn cleanup’ to remove locks (type ‘svn help cleanup’ for details)

C:projectsXXX>svn cleanup
svn: Unable to lock ‘cakescriptstemplatesskelplugins’

C:projectsXXX>sudo kill svn[/code]

Sometimes, I rather not use SVN. Can’t cleanup, can’t update too. In such cases… Probably I just delete the whole directory and recheckout again:

[code lang=”dos”]C:projectsXXX>rd /s cake
cake, Are you sure (Y/N)? y

C:projectsXXX>svn cleanup

C:projectsXXX>svn update[/code]

Yeah, not the most brilliant of ideas.