Wouter Verhelst wrote: > This obviously doesn't work very well with git-annex. My first attempts > of today caused some data loss, because git-annex adds the empty file to > the annex and marks it as read-only; since the scanner software already > performed a check on the file, it appears to assume it can be written to > and ignores any write errors it may end up with.
This wouldn't happen if you were using direct mode, which keeps the files unlocked and editable once annexed.. Or well, it would be less likely. IIRC git-annex still briefly locks down file permissions when ingesting them in direct mode. I have been meaning to disable that since it probably does not add any value. > Reading the git-annex manpage, I found the annex.largefiles option, > which I set to "largerthan=1kb" in an attempt to make it ignore the > empty files. This works, but does not behave as I expected; rather than > ignoring the file, it commits the empty file to git. When the scanner > software then finishes doing its thing, the new file is simply marked as > a modified non-annexed file; I have to do "git rm --cached file; touch > file" for the assistant to pick it up. The intent is for annex.largefiles to control what files are added to git-annex, while .gitignore blocks files from being added to both git and git-annex. However, .gitignore support is not ready, waiting on git changes. (Already have bugs tracking that.) I think this makes sense in many use cases, for example if doing game development you'd make annex.largefiles match game assets, and not match source code. So it seems that to handle your use case, we would need another configuration setting, which would make files matching it not be added to the annex, or to git, even if they're not gitignored. There is overlap with gitignore here, but when the new option marches on file size, it would do something that cannot be accomplished by gitignore. I am having trouble coming up with a name for such an option; if I had a good name for it I think I could implement it pretty quickly. -- see shy jo
signature.asc
Description: Digital signature