Cooked this one up this morning… It will iterate through `svn st | grep \?` and ask for confirmation before adding to your subversion project. Of course, all the cool kids are using git these days anyways ;) Shouldn’t be hard to modify for that.
UPDATE: actually, there is no need for such a task with git. You can just use “git commit -a”.
namespace :svn do
desc "Add files not under (sub)version control"
task :add do
files = `svn st | grep \?`.map{|f| f.gsub(/\?\s+(.+)\n/){$1} }
puts "No new files to add." and return if files.empty?
files.each do |file|
print "... #{file} [Yn]"
`svn add #{file}` unless STDIN.gets =~ /^n/i
end
end
end
the scripts mentioned here come in handy… you can check them out via subversion: svn co http://ssel.vub.ac.be/svn-gen/bdefrain/fmscripts/
install them somewhere in your path (I like to use ~/bin)
then set these helper apps in your ~/.subversion/config:
### Set diff-cmd to the absolute path of your 'diff' program.
### This will override the compile-time default, which is to use
### Subversion's internal diff implementation.
### diff-cmd = fmdiff
### Set diff3-cmd to the absolute path of your 'diff3' program.
### This will override the compile-time default, which is to use
### Subversion's internal diff3 implementation.
diff3-cmd = fmdiff3
you can do conflict resolution with filemerge directly from textmate… with Ctrl-Shift-A -> Resolve Conflicts with FileMerge…
UPDATE: it’s pretty annoying to set diff-cmd to fmdiff… you get filemerge popping all the time when you might not need it. The best of both worlds is to set the Shell Variable in textmate Advanced preferences: variable: TM_SVN_DIFF_CMD value: fmdiff This way you get nice graphical diffs in textmate, but you get the straight up text stuff in the shell.
SVN is a great tool, and having it work the way you want is even better. I don't want SVN to pay attention to things like my Rails log files and other artifacts.
There is a simple way to have SVN behave, and have it applied globally to all of your SVN working copies. Just edit the SVN config file located at ~/.subversion/config. Find the "global-ignores" part, and edit it as shown below:
global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store .project *.log database.yml ruby_sess* schema.rb
The default file patterns file patterns are common file artifacts that you would want to avoid like compilation products, backup files, and the like. The patterns .project *.log database.yml ruby_sess* schema.rb ignore any RadRails/Eclipse project files, log files (Rails log files), and Rails database configuration files, ruby session state files, and Rails database schema dump files, respectively.
Since you can use pattern matching, you can get pretty creative with how you ignore files. Or, you can always just individual files without using patterns at all. Once you save this file, your changes instantly effective.
