How to reproduce
Suppose we have two text files and a dangling symlink:
mkdir walktest && cd walktest
echo hello > a.txt
echo hello > z.txt
ln -s nonexistent b.txt
hister import file .
What I want here is for a.txt and z.txt to be imported and b.txt skipped.
Instead, Hister gives this error:
Error! walk input directory <dir>: stat <dir>/b.txt: no such file or directory
and nothing is imported (not even a.txt).
Version
I built Hister built from master (2114e9) with Go 1.27.0 on macOS 26.6.2.
Workaround
find ignores broken links, so this works:
find DIR -type f -print0 | xargs -0 hister import file
Suggested fix
I think the indexer already handles this: walkDirectoryFilesForUser() in
server/indexer/files.go:221-227 logs a warning and returns nil to keep
walking. The import walk could do the same if there's a walkErr or if os.Stat fails.
Would you like me to contribute a patch?
How to reproduce
Suppose we have two text files and a dangling symlink:
What I want here is for
a.txtandz.txtto be imported andb.txtskipped.Instead, Hister gives this error:
and nothing is imported (not even
a.txt).Version
I built Hister built from master (
2114e9) with Go 1.27.0 on macOS 26.6.2.Workaround
findignores broken links, so this works:find DIR -type f -print0 | xargs -0 hister import fileSuggested fix
I think the indexer already handles this:
walkDirectoryFilesForUser()inserver/indexer/files.go:221-227logs a warning and returnsnilto keepwalking. The import walk could do the same if there's a
walkError ifos.Statfails.Would you like me to contribute a patch?