hbons/SparkleShare — Issue #564: Common exclude rules
Author: adriangibanelbtactic
Created: 2012-01-29 13:52:07+00:00
State: open

If you look at current Git backend implementation:
```
https://github.com/hbons/SparkleShare/blob/master/SparkleLib/Git/SparkleFetcherGit.cs
```
you will notice the InstallExcludeRules part:
```
// gedit and emacs
writer.WriteLine ("*~");

// Firefox and Chromium temporary download files
writer.WriteLine ("*.part");
writer.WriteLine ("*.crdownload");

// vi(m)
writer.WriteLine (".*.sw[a-z]");
writer.WriteLine ("*.un~");
writer.WriteLine ("*.swp");
writer.WriteLine ("*.swo");

// KDE
writer.WriteLine (".directory");

// Mac OS X
writer.WriteLine (".DS_Store");
writer.WriteLine ("Icon?");
writer.WriteLine ("._*");
writer.WriteLine (".Spotlight-V100");
writer.WriteLine (".Trashes");

// Omnigraffle
writer.WriteLine ("*(Autosaved).graffle");

// Windows
writer.WriteLine ("Thumbs.db");
writer.WriteLine ("Desktop.ini");

// MS Office
writer.WriteLine ("~*.tmp");
writer.WriteLine ("~*.TMP");
writer.WriteLine ("*~*.tmp");
writer.WriteLine ("*~*.TMP");
writer.WriteLine ("~*.ppt");
writer.WriteLine ("~*.PPT");
writer.WriteLine ("~*.pptx");
writer.WriteLine ("~*.PPTX");
writer.WriteLine ("~*.xls");
writer.WriteLine ("~*.XLS");
writer.WriteLine ("~*.xlsx");
writer.WriteLine ("~*.XLSX");
writer.WriteLine ("~*.doc");
writer.WriteLine ("~*.DOC");
writer.WriteLine ("~*.docx");
writer.WriteLine ("~*.DOCX");

// CVS
writer.WriteLine ("*/CVS/*");
writer.WriteLine (".cvsignore");
writer.WriteLine ("*/.cvsignore");

// Subversion
writer.WriteLine ("/.svn/*");
writer.WriteLine ("*/.svn/*");
```
As you can see there are some common files like hidden directories and backup files. There are some backend specific files too.

The problem is that when I want to write another backend.
Wouldn't it be nice if I could just recycle the common files like hidden directories and backup files?

I think the implementation could be an array or an struct or whatever you use in mono so that once you are in your backend you can do a "foreach" in each of the array elements and write your configuration file with the syntax you want to.

Git syntax seems to be very easy: One pattern per line but maybe other backends need other kind of syntax for exclude files.