I'm using the Microsoft Sync Framework to sync files using the FileSyncProvider. One thing I noticed is that the method DetectChanges of the FileSyncProvider is ignoring or not detecting certain files.
These files are not locked by any process, the user has full rights to these files, and they are not password protected. The problematic files consist of two PDFs and one Word document. However, there are other PDFs and Word documents in the batch that are in fact being detected. I have copied the files over to another PC and had no luck.
I'm baffled as to why these files are not being detected. Thoughts?
The problem ended up being that the problematic files had the T or Temporary attribute. I was excluding files that had the T attribute. To alleviate this, I added an exclude for files or folders that had the .tmp extension.
FileSyncScopeFilter fileSyncScopeFilter = new FileSyncScopeFilter();
fileSyncScopeFilter.AttributeExcludeMask = FileAttributes.System | FileAttributes.Hidden;
fileSyncScopeFilter.FileNameExcludes.Add("*.tmp");
fileSyncScopeFilter.FileNameExcludes.Add("*.lnk");
fileSyncScopeFilter.FileNameExcludes.Add("*.pst");
Related
This question already has answers here:
Is it possible to exclude files from git language statistics?
(2 answers)
Closed 2 months ago.
Solution:
Create .gitattributes in git folder and paste linguist-languate=text after the file path. Example:
/other_libraries/* linguist-language=text
/linguist_ignore.c linguist-language=text
Note: linguist-vendored=false didn't solve the problem. GitHub still detected marked files as C code.
Problem:
My C++/OpenGL project is compiled using glad.c, and stb_imbage.h is included in mail.cpp file. Both located in root folder which contains .git directory. These two files have to be present in order to compile the project, so I want to keep them.
Issue: GitHub indexes these files and adds them to Language statistic. It is undesirable since it is not the files containing my code.
How do I keep certain files tracked by Git but exclude them from Languages?
I've tried looking for solution in GitHub docs about Linguist and Stack Overflow but without success.
I know how to ignore files using .gitignore. But it's not the solution since ignored files just won't be commited.
GitHub uses Linguist library to generate the language stats.
At https://github.com/github/linguist/blob/master/docs/overrides.md you can read about the ways to override the default behavior using a .gitattributes file. It looks like the following section fits your case the most:
Vendored code
Checking code you didn't write, such as JavaScript libraries, into your git repo is a common practice, but this often inflates your project's language stats and may even cause your project to be labeled as another language. By default, Linguist treats all of the paths defined in vendor.yml as vendored and therefore doesn't include them in the language statistics for a repository.
Use the linguist-vendored attribute to vendor or un-vendor paths:
(exmaple follows)
Recently, newer versions of cppcheck (2.8.2) are create files ending with .analyzerinfo for every source file in my repository.
So example.c would have a file created called example.c.analyzerinfo.
Is there a way to control where these files are stored?
The --cppcheck-build-dir is set and populated with files but the analyzerinfo files are still created in my source directory.
It's a recent bug, as mentioned here. It hasn't yet been fixed since the offending commit.
So I'm trying to figure out a suitable gitignore for an OpenGL project. I have the standard C++ gitignore.
Now it ignores .objs, for compiled object file, rightfully so.
However, it also ignores models that are of the .obj format and I do want tracked by version control.
How can I have setup the gitignore to ignore .objs, except from the Assets directory?
If the models are .obj, you should be able to just use
*.objs
in your gitignore to ignore compiled object files, while not ignoring .obj files because they will not match that.
If you want to not ignore .objs that are inside of the Assets folder, you can do
# Ignore compiled files
*.objs
# Don't want to ignore .objs files in Assets
!Assets/*.objs
From gitignore documentation:
An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined. Put a backslash ("\") in front of the first "!" for patterns that begin with a literal "!", for example, "!important!.txt".
In the "Excluded Regions" of the CVS configuration, I have added the following:
.*/.*/.*\.d
.*/.*/.*\.o
.*/.*/.*\.so
.*/.*/.*\.a
.*/.*/.*\.exe
.*/.*/.*\.obj
.*/.*/.*\.dll
.*/.*/.*\.lib
.*/.*/.*\.txt
.*/.*/.*\.tar
.*/.*/.*\.tar\.gz
All files with the above extensions should be ignored. However, Jenkins still runs builds based on the fact that a file "build.txt" in some folder ABC has changed, or the one of the tar.gz files has changed. How to get Jenkins to ignore these files? Is something wrong with my regex?
Glad that worked for you! Reposting as requested:
My guess is it has to do with the .*/ parts. Have you tried it with just .*\.txt?
Just as an experiment, you might also try /.*/.*/.*\.txt (note the extra / at the beginning). I have a feeling the problem was related to using relative vs. absolute file paths.
Been fighting with Mercurial's .hgignore for a while under Windows.
I have a folder named Upload which is currently empty. I do want it tracked so I added a .empty file in it which work fine. I want this so that new developers doing an hg clone get the Upload document required for the application.
Thing is I never want the folder to be populated with anything on the source control itself (test uploads from a development machine).
Example:
If I add Public/image.jpg it wouldn't be tracked.
Additionally I would like it for sub directory to be tracked. So if developer adds
Upload/users/.empty I would like this to be tracked.
Is this possible with regex voodoo?
In mercurial (and unlike in svn and cvs) adding a file overrides the .hgignore file, so you can put this in your .hgignore:
^Uploads/.*
and your Upload/.empty that you added will still be created on update and thus they'll get the directory.
Getting it to ignore files in upload but not not ignore files in subdirectories in Upload could be done with:
^Uploads/[^/]*$
which says: ignore anything that Starts with Uploads and has no further slashes in it.
Really though, you should be creating Uploads with your build/install/configure script when possible, not with the clone/update.
Try putting
Uploads/(?!.empty)
in .hgignore in the root of the repository
Try
^Uploads\b.*/(?!\.empty)[^/]+$
This should match any path starting with Uploads where the text after the last slash (=filename) is anything but .empty.