Skip to content

Instantly share code, notes, and snippets.

@wtnabe
Created September 21, 2011 05:38
Show Gist options
  • Save wtnabe/1231336 to your computer and use it in GitHub Desktop.
Save wtnabe/1231336 to your computer and use it in GitHub Desktop.
list svn-untracked files with .gitignore ( without svn:ignore )
desc 'list svn untracked files'
task 'svn-untracked' do
excludes = File.read( File.dirname(__FILE__) + '/.gitignore' ).lines.map(&:chomp)
list = Rake::FileList[`svn stat --ignore-externals | awk '$1 == "?" {print $NF}'`.lines.map(&:chomp)]
excludes.each { |ex|
list.exclude( ex )
}
puts list.select { |e|
File.file?( e )
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment