Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symlink support #8

Open
eigengrau opened this issue Jul 27, 2015 · 2 comments
Open

Symlink support #8

eigengrau opened this issue Jul 27, 2015 · 2 comments

Comments

@eigengrau
Copy link

Currently, hf doesn’t seem to list symlinks pointing to files. This isn’t a problem if the files are accessible as regular files too (though some people might prefer having the symlink names available anyway, since their names might be different). However, in some use-cases, the symlinks might point to destinations which are otherwise pruned away (e. g., a file in a dotted directory); this will then lead to some files not available listed for completion at all.

E. g., git-annex stores large BLOBs in git by managing them as symlinks to a path of the form .git/annex/objects/…. I keep notes and lots of other stuff in these repositories, and accordingly none of the filenames are currently given as completions when using hf.

@hugows
Copy link
Owner

hugows commented Jul 27, 2015

Unfortunately .git folders are ignored - do you have any suggestion to fix this?

@eigengrau
Copy link
Author

My thought was that if one just lists the link names nominally (without dereferencing them), there should be no .git prefix, so the pruning logics for dotted directories should not be a problem, should they? IMHO not dereferencing the symlinks is preferable in any case. So, when walking the files, could you include (or add an option to include) symlinks as well as regular files?

hf is meant to only complete files, right? I guess in that case, in addition to the above, you’d also want to check whether the link targets are regular files (so you’d dereference temporarily for this check, but you’d still return the name of the link, not the name of the target).

Would this work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants