[[!comment format=mdwn
 username="joey"
 subject="""comment 1"""
 date="2017-10-16T16:08:18Z"
 content="""
The "<file> not found" error message comes from
CmdLine.Seek.checkFileOrDirectoryExists, which is intended to catch
git-annex being run with a parameter that does not exist on disk and let
the user know about their mistake.

Seems like that that's being called from withFilesOldUnlocked,
or withFilesMaybeModified. Both of which Command.Add
calls after withFilesNotInGit.

With -J, I suppose there could be worker threads still running
to ingest withFilesNotInGit when it moves on to
withFilesOldUnlocked.

There is a window during file ingestion where the file has been 
removed from the working tree and the annex symlink has not been
created yet. Probably that is triggering checkFileOrDirectoryExists.
Although I'd expect that window to be small, so it's somewhat surprising
that yoh could reproduce this problem multiple times.

The problem could be fixed in several different ways. Could wait for
worker threads to finish before moving on to the next `with*` seek.
Could make checkFileOrDirectoryExists only be run once, rather than 3
times in `git annex add` (which is surely unncessary work..). Or could
try to eliminate the window where the file is not present in the working
tree. It may be worth doing several of those.
"""]]
